|home| |posts| |projects| |cv| |bookmarks| |github|

20 20 20 Rule Remainder With Cron and Dunst

What's cron?

cron is a time-based job scheduler. It means you can run specific operations at a certain time.

What's dunst?

dunst is a lightweight and customizable notification daemon. You can post notifications from the command line using the tool dunstify.

Add a crontab rule for the 20-20-20 rule

echo $DISPLAY
echo $DBUS_SESSION_BUS_ADDRESS
*/20 * * * * DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus dunstify -u critical "Time to take a break" "Get up, strech your legs and rest your eyes"

This will create a popup notification with the given title and description and which will stay active until you click on it.