Persistent Notification -using Zenity and crontab

The Problem: I wanted a "persistent" (nagging?)pop up notification that reminded me to do something at a specific time every day. even if no other apps were running and regardless of any workspace I was currently viewing.
The solution: "zenity" running in a cron job.
Try this first ; zenity was already installed in UM18.04LTS -
From the terminal, type zenity --info --text "put your text here" . You should see an info box open on the screen with your text. It will stay there until you click "OK"
SO - I added it to the crontab thus -
from the terminal-
crontab -e ((this opens an editor or offers a choice of editors))
scroll to the bottom and add
0 14 * * * export DISPLAY=:0 && zenity --info --text "Do this NOW. Uh Uh don't click OK"
(( at 2PM local, every day zenity will pop an "info" note on your desktop. The export DISPLAYj=:0 just puts it on your first display if you have more than one.
CTL-O, Return, ((to save the crontab-; CTL-X ((to close the editor))


For a notification as in a literal notification, there's also:

export DISPLAY=:0 && notify-send "Title here" "Text here" --icon clock --expire-time=10000

10000 milliseconds = 10 seconds

1 Like

There's also a flag for notify-send that persists the notification until you click on it. I think it's something like --urgency=critical combined with --expire-time=-1 or something along those lines...

1 Like

As a user that has very little experience with the linux DE- I'm just starting to understand why Linux devs live in the terminal and use the CLI. I'll play around with notify-send and see what I can come up with. Thanks.