A command-line utility for scheduling system wake-ups and alarms on Linux systems using rtcwake.
- Schedule system wake-ups with optional alarm
- Natural language date/time input (e.g., "tomorrow at 8am", "in 2 hours")
- Custom startup commands support
- Test mode for alarm verification
- Cancel scheduled wake-ups
- Linux operating system
- Node.js and npm installed
- VLC media player (
cvlc) sudoprivileges (required forrtcwake)
- Clone the repository:
git clone https://github.com/yourusername/klickwake.git
cd klickwake- Install dependencies:
npm install- Install required Node.js packages:
npm install chrono-node readline- Make the script executable:
chmod +x klickwake.cjs- (Optional) Create a symbolic link to run from anywhere:
sudo ln -s $(pwd)/klickwake.cjs /usr/local/bin/klickwakeRun the script:
./klickwake.cjsOr if you created the symbolic link:
klickwake- Alarm: System will wake up and play an alarm sound
- Power on only: System will wake up without an alarm
- Cancel: Cancel any scheduled wake-ups
- Test alarm: Test the alarm sound (20-second delay)
- Custom startup command: Run a custom command after wake-up
- Schedule wake-up for tomorrow morning:
Enter a date and time: tomorrow at 8am- Schedule wake-up in 2 hours:
Enter a date and time: in 2 hours- Schedule wake-up for specific date/time:
Enter a date and time: December 25th at 7:30amThe default alarm sound and sleep mode can be modified in the script:
const alarmSound = '/path/to/your/alarm.mp3';
const sleepMode = 'mem'; // or 'disk' for hibernate-
If you get permission errors:
- Ensure you have sudo privileges
- Check that rtcwake is installed (
sudo apt-get install util-linux)
-
If the alarm doesn't play:
- Verify VLC is installed (
sudo apt-get install vlc) - Check the alarm sound file path is correct
- Verify VLC is installed (
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.