Hack to disable Gnome screensaver while running MPlayer.

I don't know about you, but I really hate having to push buttons or move the mouse every few minutes every single time that I try to watch a video on linux. If you are using gnome screensaver and Mplayer then this simple hack will sole your problems.

This hack is a simple python script. When executed the script will disable the screensaver, open mplayer, and then re-enable the screensaver when Mplayer is closed. Type the following into gedit and save it as screensaverhack.py:
#!/usr/bin/python

import subprocess

# close gnome-screensaver
subprocess.Popen(["gnome-screensaver-command", "--exit"])

# run gmplayer (put command which runs your favorite video player instead "gmplayer"
player = subprocess.Popen("gmplayer")

# wait till mplayer exits
player.wait()

# start gnome-screensaver again
subprocess.Popen("gnome-screensaver")
Remember to chmod +x this file to allow executing! I hope this helps!

Share this post!

Bookmark and Share

0 comments:

Post a Comment

Our Recent Videos


Contact Us!Popular:   WindowsLinuxInternet

Shop Amazon