Automatic pause MOC player when gnome screensaver runs
29. 12. 2009 15:06 | Linux, PC, Programing | Komentáře nejsou povolené u textu s názvem Automatic pause MOC player when gnome screensaver runsI want to pause my MOC player when i locked my NB, here is a little script which i run on startup:
#!/usr/bin/perl my $cmd = "dbus-monitor --session \"type='signal',interface='org.gnome.ScreenSaver',member='ActiveChanged'\""; open (IN, "$cmd |"); while () { if (m/^\s+boolean true/) { system ("mocp --pause"); } elsif (m/^\s+boolean false/) { system ("mocp --unpause"); } }
Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds.
Valid XHTML and CSS. ^Top^