![]() # Call screen saver lock for Ubuntu versions > 14.04.ĭbus-send -type=method_call -dest= \ Rm "$WORK_FILE" # Remove countdown work file # Record number of minutes remaining to file other processes can read.Įcho "Lock screen in: $MINUTES Minutes" > "$WORK_FILE" Paplay /usr/share/sounds/freedesktop/stereo/complete.oga "C:\Windows\Media\notify.wav").PlaySync() ' Powershell.exe -c '(New-Object Media.SoundPlayer \ "Locking screen in ""$MINUTES"" minute(s)." icon=/usr/share/icons/gnome/256x256/status/appointment-soon.png \ If ] || ] thenīreak # zero minutes considered cancel. text="Set number of minutes until lock" -entry-text="$DEFAULT")īreak # break out of timer lock screen loop and end this script.ĭEFAULT="$MINUTES" # Save deafult for subsequent timers. MINUTES=$(zenity -entry -title="Lock screen timer" \ # Get number of minutes until lock from user # still exist if +C was used to kill last instance launched from # Remove ~/.lock-screen-timer-remaining on startup. If cat /proc/version | grep Microsoft then # Running under WSL (Windows Subsystem for Linux)? text="Previous lock screen timer has been terminated." Zenity -info -title="Lock screen timer already running" \ PREVIOUS=$(echo "$pID" | grep -v ^"$$") # Strip out this running copy ($$$) PID=$(pgrep -f "$") # All PIDs matching lock-screen-timer name # Check if lock screen timer already running ![]() # WORK_FILE contains number of minutes remaining until lock screenĭEFAULT="$MINUTES" # When looping, minutes count down to zero. # if no parameters set default MINUTES to 30 MINUTES="$1" # Optional parameter 1 when invoked from terminal. # Write time remaining to ~/.lock-screen-timer-remaining # Pending lock warning displayed at set intervals. # If zenity is closed with X or Cancel, no screen lock timer is launched. # Zenity is used to pop up entry box to get number of minutes. ![]() # If previous version is sleeping it is killed. # UPDT: Updated to support WSL (Windows Subsystem for Linux) # CALL: Place on Desktop or call from Terminal with "lock-screen-timer 99" Toggle back to this screen and copy the following code by highlighting it and pressing Ctrl+ C: #!/bin/bash Open the Terminal using Ctrl+ Alt+ T and type: gedit lock-screen-timerĬopy and paste code from window below to lock-screen-timer Use gedit to create script lock-screen-timer Add fenced code block: ``` bash - for script syntax highlighting.Make images in this post smaller by appending m (medium) to their filenames.The following cosmetic changes were made to this answer: If previous timer was run from command line and cancelled with Ctrl+ C then $WORK_FILE removed on script startup. A future powershell.exe script is planned for Windows 10 notification area support.Įdit 9 (Feb 19,2018): Fix animation missing the \ from spinning pizza |,/,─,\ sequence.Įdit 10 (Nov 14,2021): New variable WORK_FILE set to ~/.lock-screen-timer-remaining. Windows 10 system tray / notification area time remaining display requires complementing what indicator-sysmonitor does in Linux. Note you need to add VcXsrv and ubuntu-desktop or xubuntu-desktop (preferred) to use Linux GUI in WSL. to support multiple users on network.Įdit 7: REDACTED because ogg123 is no longer used.Įdit 8 (Nov 12,2017): Add WSL (Windows 10 Subsystem for Linux) support. This allows other programs to displayĮdit 6 (Aug 07,2017): Change /tmp/ work file directory to ~/. ie Laundry night - 16 minutes to rinse cycle (fabric softener), 13 minutes to load dryer, 58 minutes to take out of dryer.Įdit 5 (Feb 11,2017): Write minutes remaining to Add information message if previous version was already running and terminated.Įdit 4 (Feb 4,2017): Run in loop for multiple countdowns without having to re-click desktop icon. Use zenity to get number of minutes (defaults to 30).Įdit 2 (Nov 20,2016): Code change to kill previous sleeping script.Įdit 3 (Jan 20,2017): Revise killing previous script code. Impending lock warnings at 15, 10, 5, 3, 2 and 1 minute(s) remaining using message and sound. Configure Nautilus to execute bash scriptsĮdit 1 (Nov 19, 2016): Final version.Mark lock-screen-timer as an executable.Copy and paste code from this window to lock-screen-timer.Use gedit to create script lock-screen-timer.A much superior program called multi-timer has been created: Set of countdown timers with alarm Lock Screen TimerĬreate your own Lock Screen Timer instead of 3rd Party applicationsĪlthough there are 3rd Party applications to do this, you can create your own.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |