I'm still having issues with the screensaver (I use xscreensaver) going on when I'm in the middle of games. I'd be playing on the gamepad and I would get interrupted.
I understand that there are two factors involved:
- the games (and programs like WINE, emulators, etc) aren't disabling the screen saver like they should (solve with caffeine)
- the gamepad's actions aren't holding off the screensaver like they should (solve with joystickwake)
I looked at the existing solutions and of course I said: I'm going to roll my own.
A script to
enable_blanking:
Code:
#!/usr/bin/env bash
sed -i 's/\(timeout:\s\+\)[0-9:]\+/\10:10:00/g' ~/.xscreensaver
A script to
disable_blanking:
Code:
#!/usr/bin/env bash
sed -i 's/\(timeout:\s\+\)[0-9:]\+/\112:00:00/g' ~/.xscreensaver
Notice that all they do is sed the xscreensaver config file and change the blanking interval there. This works because that file gets automatically reloaded whenever it's changed.
For desktop integration, I just put them in my PATH and launch them from
dmenu.
Oh, and to show the current screen blanking interval?
A script to
show_blank_interval:
Code:
#!/usr/bin/env bash
cat ~/.xscreensaver | awk '/timeout/ {print $2}'
You just put that into any status indicator that shows command output: i3bar, xmobar, conky, whatevever.
Here's my line in ~/.conkyrc:
Code:
${exec show_blank_interval}