A shell script to play an alarm at a predetermined time. Optional feature for dwm-bar.
- Creates a temporary file so the current status can be used in other scripts (e.g. dwm-bar).
- Alerts the user with a notification.
- Prevents multiple instances of the script running at once.
- libnotify for notifications
- mpv to play alarm sound
- Clone the repository:
$ git clone https://github.com/hollystandring/alarm
- Enter the directory:
$ cd alarm
- Allow running of the script:
$ chmod +x alarm.sh
- Optionally add it to a directory in the PATH:
$ sudo cp alarm.sh /bin/
- Run the script:
$ ./alarm.sh
For an alarm sound to play, you must edit the "ALARMSOUND" variable in alarm.sh:
ALARMSOUND="/path/to/alarmsound.mp3"
You can run alarm.sh with 3 arguments corresponding to the time for the alarm to play (HH:MM:SS):
$ ./alarm.sh 14 30 0
Alarm set for 14:30:00
Alternatively, if you run the script with less than 3 arguments, you will be prompted for the hour, minute, and second:
$ ./alarm.sh
Hour: 1
Minute: 30
Second: 0
Alarm set for 14:30:00
If you want to stop the countdown, you can run
killall alarm.sh