Sunday, 24 June 2012

Gnome Screensaver Not Disabling With VLC


Found this neat solution to gnome screensaver still coming up with your watching content in VLC, even with the option to disable ticked. Will work for any linux based OS although some my require you to change the /usr/bin/vlc part to the relevant one for you OS. As with any system hacks it’s a good idea to test the code before editing the /usr/bin/vlc link.
All credit goes to original poster.
For the longest time vlc on linux has not properly stopped gnome-screensaver from loading it’s screensaver even with the checkmark to stop screensaver from running
i found out this is because it’s either a) calling the wrong command or b) gnome-screensaver is not recognizing it
anyway, i developed a quick and dirty workaround for it and thought i would share it here

#!/bin/bash
gnome-screensaver-command -i & pid=$! 
vlcn "$1" && kill -n 1 $pid


now all you have to do is paste that into a text document and make it executable then re-link your /usr/bin/vlc to the script you just made using

ln -s /home/user/path/to/script /usr/bin/vlc
also you will see it’s calling vlcn “$1″ this is because before i relinked /usr/bin/vlc i rename/usr/bin/vlc to /usr/bin/vlcn
this has to be redone each time you update your vlc, but it’s less of an inconvenience than moving your mouse every X minutes or disabling your screensaver and power options prior to watching any movies
it’s still immature in it’s code and will spawn a new instance of the interrupt with each vlc instance but i haven’t yet figured a good way to have only one instance of the interrupt for all instances of vlc and figured most won’t watch multiple movies at the same time anyway

No comments:

Post a Comment