So I made a new script for this purpose that uses the "gnome-screensaver-command -i" call. The -i or --inhibit command argument stops/inhibits gnome screensaver and gnome power manager at the same time. Here is the full script:
#!/usr/bin/python
import subprocess
#run inhibition
ss_inhibit = subprocess.Popen(["gnome-screensaver-command", "-i", "-n",
"mplayer", "-r", "video"])
#run gmplayer
player = subprocess.Popen("gmplayer")
#wait for mplayer to exit
player.wait()
#kill the inhibition
ss_inhibit.kill()
Inhibition command is:
gnome-screensaver-command -i -n mplayer -r video
Options used here are:
-i -> inhibit the screensaver from activating.
-n mplayer -> the calling application that is inhibiting the screensaver is mplayer.
-r video -> reason for inhibiting the screensaver - video
0 comments:
Post a Comment