4

I am monitoring my computer screen time usage and I often find myself running uptime --pretty and I would like to find out a better way. My goal is to to wrap my work up within 2 hours of sitting at the computer. My ideas are to have a program launch at first boot login, then at the 1.5 hr or 2 hr mark set off a notification on my notification tray so that I may save my work and logout/poweroff. I know how to set programs to launch at startup via startup applications however clueless how to fire notifications. I am using 20.04 on Gnome.

Raffa
  • 34,963
Weezy
  • 481

1 Answers1

6
  • Use the sleep command with h(hours) like so:

    sleep 2h
    
  • With the notify-send command like so:

    notify-send "Please wrap up your work."
    
  • Both in a sh command string sh -c '...' like so:

    sh -c 'sleep 2h; notify-send "Please wrap up your work."'
    
  • Then, add a new startup application and paste the above sh command string in the command field like so:

    enter image description here

  • Then, save it.

  • Next time you login and thereafter, you will be notified after two hours of login.

Raffa
  • 34,963