I built this quickly....maybe too quickly.
It plays a random audio file and shows a desktop notification on KDE (or any Linux desktop with notify-send and PulseAudio/PipeWire).
I needed something to remind me to go to bed. I don't always see the desktop clock, I keep my phone face down after work, and other reasons.
Why put this on GitHub? It backs it up and might be something someone else can use.
- Picks a random
.ogg,.mp3, or.wavfrom a folder. - Shows a critical notification with the file name (bypasses Do Not Disturb).
- Plays the audio with
paplay. - Can be installed as a systemd user service to run automatically at a scheduled time.
notify-send(usually inlibnotify-bin)- PulseAudio or PipeWire with
paplay - Audio files in a directory you control
-
Run the installation script:
chmod +x install.sh ./install.sh
This will:
- Copy the script to
~/.local/bin/bedtime-reminder.sh - Copy bundled sounds to
~/.local/share/bedtime-reminder/Sounds - Auto-configure your username and the default audio directory
- Prompt for your bedtime and whether to use bundled sounds
- Set
AUDIO_DIRand install systemd service and timer files - Enable and start the timer at your chosen time (defaults to 23:00)
- Play a test notification and sound to confirm everything works once installed
- Copy the script to
-
To customize the schedule later, edit
~/.config/systemd/user/bedtime-reminder.timerand change theOnCalendarvalue, then run:systemctl --user daemon-reload systemctl --user restart bedtime-reminder.timer
-
Edit
KDEBedtime.shand set your username and audio directory (required for manual setup):USER_NAME="your_username" AUDIO_DIR="/path/to/your/audio/files"
-
Make the script executable:
chmod +x KDEBedtime.sh
-
If you want the bundled sounds, copy them and set
AUDIO_DIRto match:mkdir -p ~/.local/share/bedtime-reminder cp -r Sounds ~/.local/share/bedtime-reminder/
Once installed, the timer runs automatically. Useful commands:
# Check timer status
systemctl --user status bedtime-reminder.timer
# List all active timers
systemctl --user list-timers
# Test the service manually
systemctl --user start bedtime-reminder.service
# View logs
journalctl --user -u bedtime-reminder.service
# Stop the timer
systemctl --user stop bedtime-reminder.timer
# Disable the timer (won't start on login)
systemctl --user disable bedtime-reminder.timer
# If it triggers on login, the service was enabled; disable it
systemctl --user disable --now bedtime-reminder.service./KDEBedtime.shThe installer will ask if you want to use bundled sounds or provide your own directory during installation.
If you chose bundled sounds, they're located at:
~/.local/share/bedtime-reminder/Sounds
To switch to custom audio files after installation:
-
Put your
.ogg,.mp3, or.wavfiles in a folder you control. -
Edit
~/.local/bin/bedtime-reminder.shand setAUDIO_DIRto that folder. -
Restart the timer so the change applies:
systemctl --user restart bedtime-reminder.timer
To remove the service:
./uninstall.sh- This is Wayland-friendly and uses
XDG_RUNTIME_DIRand the user D-Bus socket instead of Xorg variables. - It works best as a systemd user service or when run from your logged-in session.
- If you are not logged in, the user runtime directory and session bus are not available, so notifications and audio will fail.
- "No audio files found": double-check
AUDIO_DIRand file extensions. - Notifications not showing: verify
notify-sendis installed and yourDBUS_SESSION_BUS_ADDRESSandXDG_RUNTIME_DIRare correct. - Audio not playing: confirm
paplayworks from your terminal and that your audio server is running. - Triggers on login: make sure the service is not enabled and only the timer is enabled.
This project's code is licensed under GPL-3.0. See the LICENSE file for details.
Note: The bundled sound files in the Sounds/ directory have separate licenses from third-party sources. See Sounds/LICENSE for details.
- Quack sound: https://pixabay.com/sound-effects/075176-duck-quack-40345/
- Sound Effect by freesound_community from Pixabay
- Ducktoy: https://quicksounds.com/sound/22456/duck-toy-sound
- Inspiration: https://github.com/elly-code/reminduck
- First bug tester: Chris (Thank you)