Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
/ alarm Public archive

A shell script to play an alarm at a predetermined time

License

Notifications You must be signed in to change notification settings

hollystandring/alarm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Alarm

A shell script to play an alarm at a predetermined time. Optional feature for dwm-bar.

Features

  • 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.

Optional dependencies

  • libnotify for notifications
  • mpv to play alarm sound

Installation

  1. Clone the repository:
$ git clone https://github.com/hollystandring/alarm
  1. Enter the directory:
$ cd alarm
  1. Allow running of the script:
$ chmod +x alarm.sh
  1. Optionally add it to a directory in the PATH:
$ sudo cp alarm.sh /bin/
  1. Run the script:
$ ./alarm.sh

Configuration

For an alarm sound to play, you must edit the "ALARMSOUND" variable in alarm.sh:

ALARMSOUND="/path/to/alarmsound.mp3"

How to use

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

About

A shell script to play an alarm at a predetermined time

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages