#!/bin/bash
while true; do
sleep 10
if grep -q RUNNING /proc/asound/card*/pcm*/sub*/status; then # there is sound, so we want "movie mode"...
# xscreensaver nudge:
/usr/bin/xscreensaver-command -deactivate
# screensaver-agnostic nudge:
# xdotool key Pause
pgrep unclutter || unclutter & # if unclutter isn't running, start it
else # there is no sound, so no "movie mode"...
pgrep unclutter && pkill unclutter # if unclutter is running, kill it
fi
done
Yes, screensaver made sense back when it saved a CRT from phosphor burnout. Generally obsoleted by modern screen tech.
Now I only use one to keep a screen active.
Agree completely. No point these days really, I disable the service on startup in my Mate partitions. In openbox I just never install one.
If you just want a screenlocker, i3lock works great.
]]>On one system, I have to use a screensaver to keep the LED+LCD display from shutting down due to boredom.
If a video is playing fullscreen, I'd think suppressing the screensaver makes sense - provided someone's watching.Pausing the video as well might be a way to save electrical energy ... tradeoff for human energy, of course ... hey, wake up! Aw...
Problem is that screensavers does not actually save neither energy, running these actually uses more energy. People usually use opengl ones and with that your screen is still active, your CPU is more used, your GPU is more used.
What saves energy is only monitors DPMS (marketing name Energy Star) states are useful to really send monitor to save energy and do nothing else. For that screensaver is not needed.
Basically:
xset dpms force off
Saves energy and it wakes up on any input, doing something else actually uses more energy.
I understand as GNUser mention he runs screensavers for ornamental purposes, that is fine - so for aesthetics. But does that really save a screen? No. Does that really saves energy? Again, no.
]]>@smoki: Indeed, LCDs have no need of screensaver--I have xscreensaver on my daily driver laptop only for ornamental purposes. On the other hand, I have an old laptop that I converted into a media player (including IR receiver!) which lives permanently connected to a 60'' plasma TV. In this case, a reliable screensaver is an absolute must-have. Since I started using this script, I no longer have to depend on a manual process to turn screensaver off and on when watching videos in a web browser.
]]>Just saying maybe someone found idea useful, since screensavers actually does not save anything just might look fine.
edit: to mention computer monitors have DPMS on in EDID by default, while TVs or TV/Monitor combinations have DPMS off usually since you don't want TV to auto go to sleep by default but on PC some users like that for some reason still... well even my PC monitors never sleeps too, only when i force dpms off, timings can be set there also for those who like, etc... Thing sometimes further requre manual configurations as some GPU drivers might like to command there also... i like to disable it everywhere and to have non-automatic/manual control. But that is just me
]]>#!/bin/bash
while true; do
sleep 10
cat /proc/asound/card*/pcm*/sub*/status | grep RUNNING && xdotool key Pause
done
The Pause key does not seem to do anything at all on my system, and I can use my system normally even if the key is being pressed in the background.
]]>However, for several years I've had to use a keyboard shortcut to toggle my screensaver off when watching video in a web browser. It seems the difficulty with video in a web browser is that for some time now web browsers have been able to play video without using any external software. Therefore, from the system's perspective, it is difficult to tell whether the web browser is just sitting idly or actually playing a video.
Well, I figured out a workaround: Watch for any sound output!
#!/bin/bash
while true; do
sleep 10
cat /proc/asound/card*/pcm*/sub*/status | grep RUNNING && xscreensaver-command -deactivate
done
Just add the above script to your startup applications and voilĂ : As long as any application is outputting sound, every 10 seconds xscreensaver gets a little nudge. This works regardless of whether you have pulseaudio or just alsa.
]]>