Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.os.linux.ubuntu    |    I preferred Xubuntu, seemed a bit faster    |    134,474 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 134,036 of 134,474    |
|    Dr. Noah Bodie to All    |
|    An AI-Written "NoDoze" Bash File To Stop    |
|    06 Oct 24 19:40:52    |
   
   XPost: alt.os.linux.mint   
   From: noah@bodie.not   
      
   I did not want to install Caffeine so I prompted ChatGPT to write a   
   script that keeps the screensaver from activating when you don't want it   
   to activate. IE, while watching videos.   
      
   NoDoze checks once every 50 seconds (feel free to increase this numeral)   
   to see if you are watching a video on SMPlayer or on YouTube. If you are   
   using either one, then the screensaver won't activate. Works great!   
      
   ---   
      
   #!/bin/bash   
      
   # Check if smplayer is running.   
   is_smplayer_running() {   
   pgrep smplayer > /dev/null   
   }   
      
   # Check if the browser's active tab title contains "YouTube" and "-".   
   is_youtube_open() {   
   active_window=$(xdotool getactivewindow getwindowname)   
   echo "$active_window" | grep -iq "YouTube" && echo "$active_window" |   
   grep -iq "Mozilla"   
   }   
      
   while true;   
   do if is_smplayer_running || is_youtube_open;   
   then xdotool key Shift   
      
   fi   
   # Wait for 50 seconds before checking again. Increase this delay if needed.   
   sleep 50   
   done   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca