A simple function wrapper over the default linux desktop notifications library, to be used in conjunction with the at
command for setting quick reminders via the command-line. Just add the function to either ~/.bashrc
or ~/.bash_profile
and you're good to go. (Don't forget to source
it or restart the bash terminal)
Tested with the bash
shell on Ubuntu 17.10 . While the commands themselves should be available in most Linux distributions, some minor modifications might be needed for zsh
or other shells.
notify-send
should be installed by default on a lot of linux distributions, but in case it is missing install the notify-osd
package. For Ubuntu, you can do this by executing
sudo apt-get install notify-osd
at
is a command used to schedule 'jobs' that are executed at the specified time. It allows fairly complex time specifications apart from the standard 12-hour and 24-hour formats (Check the man
page for more details). You can install it by running:
sudo apt-get install at
The text body of your reminder must be passed to the command in quotes, so that it is treated as a single argument. Follow this with a time specified in a format accepted by the at
command.
If no time is passed, the reminder is sent immediately.
- To set a reminder for 15 minutes later
remind "body" now + 15 minutes
- To set a reminder for 7pm
remind "body" 7pm
You can pass whatever icon and tone files you wish, but the samples I've referred to in the code can be found here. Just be sure to update the path accordingly, or it will go with the default icon. There is no default tone, so you'll be left with a simple notif rather than a reminder.