From 52d3bf35380c8e70366d7609649e1ccfc0540798 Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Thu, 2 Jan 2014 22:47:36 +0100 Subject: [PATCH] Add totem detection --- lightsOn.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lightsOn.sh b/lightsOn.sh index c4e8c7d..b4ae6ee 100755 --- a/lightsOn.sh +++ b/lightsOn.sh @@ -8,7 +8,7 @@ # Description: Bash script that prevents the screensaver and display power # management (DPMS) to be activated when you are watching Flash Videos # fullscreen on Firefox and Chromium. -# Can detect mplayer, minitube, and VLC when they are fullscreen too. +# Can detect mplayer, minitube, VLC and Totem when they are fullscreen too. # Also, screensaver can be prevented when certain specified programs are running. # lightsOn.sh needs xscreensaver or kscreensaver to work. @@ -29,10 +29,11 @@ # Modify these variables if you want this script to detect if Mplayer, -# VLC, Minitube, or Firefox or Chromium Flash Video are Fullscreen and disable +# VLC, Minitube, Totem or Firefox or Chromium Flash Video are Fullscreen and disable # xscreensaver/kscreensaver and PowerManagement. mplayer_detection=1 vlc_detection=1 +totem_detection=1 firefox_flash_detection=1 chromium_flash_detection=1 minitube_detection=1 @@ -172,6 +173,18 @@ isAppRunning() fi fi + + # Check if user want to detect totem fullscreen, modify variable totem_detection + if [ $totem_detection == 1 ];then + if [[ "$activ_win_title" = *totem* ]];then + #check if totem is running. + totem_process=`pgrep -lc totem` + if [ $totem_process -ge 1 ]; then + return 1 + fi + fi + fi + # Check if user want to detect minitube fullscreen, modify variable minitube_detection if [ $minitube_detection == 1 ];then if [[ "$activ_win_title" = *minitube* ]];then