How to send a notification using at command?

Solution 1:

echo "notify-send 'hello'" | at 14:10

at is expecting a command from STDIN.

If you want to silence the /bin/sh warning, run it this way:

echo "notify-send 'hello'" | at 14:10 2>/dev/null

Solution 2:

As I was searching for a fast way to remind myself using dunstify/notify-send I want to promote @Ruslan 's comment, because it involves less typing (which is essential when you want to "just set a timer")

at now + 3minutes <<< "notify-send -t 0 'tee is ready'"

... or with less whitespace/characters:

at now+3min<<<'notify-send -t 0 tee isready'
  • -t 0 don't timeout the notification and keep it open

and just for information: as an improvement to atq or at -l listing I use an alias that also prints the executed command, not just time/queue/user:

alias ,atl='for j in $(atq | sort -k6,6 -k3,3M -k4,4 -k5,5 |cut -f 1); do atq |grep -P "^$j\t" ;at -c "$j" | tail -n 2; done'

(as mentioned here in serverfault)

* tested with Manjaro21/Debian10