Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hollystandring/alarm
A shell script to play an alarm at a predetermined time
https://github.com/hollystandring/alarm
Last synced: about 1 month ago
JSON representation
A shell script to play an alarm at a predetermined time
- Host: GitHub
- URL: https://github.com/hollystandring/alarm
- Owner: hollystandring
- License: gpl-3.0
- Archived: true
- Created: 2020-01-20T12:12:46.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-30T13:56:09.000Z (about 2 months ago)
- Last Synced: 2024-07-31T16:21:00.675Z (about 2 months ago)
- Language: Shell
- Size: 221 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Alarm
A shell script to play an alarm at a predetermined time. Optional feature for [dwm-bar](https://github.com/hollystandring/dwm-bar).
## Features
* Creates a temporary file so the current status can be used in other scripts (e.g. [dwm-bar](https://github.com/hollystandring/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:
```sh
$ git clone https://github.com/hollystandring/alarm
```
2. Enter the directory:
```sh
$ cd alarm
```
3. Allow running of the script:
```sh
$ chmod +x alarm.sh
```
4. Optionally add it to a directory in the PATH:
```sh
$ sudo cp alarm.sh /bin/
```
5. Run the script:
```sh
$ ./alarm.sh
```
## Configuration
For an alarm sound to play, you must edit the "ALARMSOUND" variable in alarm.sh:
```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):
```sh
$ ./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:
```sh
$ ./alarm.sh
Hour: 1
Minute: 30
Second: 0Alarm set for 14:30:00
```
If you want to stop the countdown, you can run
```sh
killall alarm.sh
```