SleepUntil is a bash script, which makes use of YAD to capture data for rtcwake through a GUI Dialog. Through rtcwake the OS sleeps, and wakes up at a given time (today or tomorrow).
- For now it has been tested on Ubuntu 16.04
- Install YAD using apt-get:
$ sudo apt-get install yad
- Hardware clock must be set to UTC. If not, the script must be edited (remove the -u flag from rtcwake):
[FILE: sleep_until.sh]
...
# replace "sudo rtcwake -m mem -u -t $(date +%s -d "$foo")" for:
sudo rtcwake -m mem -t $(date +%s -d "$foo")
...
- Download the script 'sleep_until.sh':
$ git clone https://github.com/babetoduarte/SleepUntil.git
$ cd SleepUntil
- Change permissions to allow execution:
$ chmod +x sleep_until.sh
- Execute the script:
$ ./sleep_until.sh
- Input parameters on GUI:
- Day: ['today' / 'tomorrow']
- Time: [Time in 24h format (i.e. 06:30 or 22:15)]