Comment 6 for bug 988949

Revision history for this message
Danjones (goodevilgenius) wrote :

xdg-screensaver requires a windowid to suspend it. Once that window disappears, gnome-screensaver automatically resumes.

I was having a problem with mplayer not inhibiting gnome-screensaver, so I wrote this bash alias to inhibit it for mplayer:

alias xdg-screensaver-mplayer-suspend="xdg-screensaver suspend $(wmctrl -l | sed -nr 's/^(0x[0-9a-f]+).+mplayer.*/\1/p')"

Obviously, you also need wmctrl installed to use it. Whenever I have mplayer running, I just run xdg-screensaver-mplayer-suspend

You could do the same thing with skype:
alias xdg-screensaver-skype-suspend="xdg-screensaver suspend $(wmctrl -l | sed -nr 's/^(0x[0-9a-f]+).+skype.*/\1/ip')"

Or, if you have YouTube in a separate window:
alias xdg-screensaver-youtube-suspend="xdg-screensaver suspend $(wmctrl -l | sed -nr 's/^(0x[0-9a-f]+).+youtube.*/\1/ip')"

You would just put the command you want into ~/.bashrc

Yes, this is a big hassle, and gnome-screensaver-command should be fixed to support inhibit again, but it's a usable workaround for the time being.