"Do something today that your future self will thank you for."
A simple Python3-based reminder tool for macOS and Linux that uses native notification systems to alert the user after a specified time. It also supports opening URLs and executing commands when the timer ends.
- Cross-platform: Works on macOS (using
terminal-notifier
) and Linux (usingnotify-send
). - Customizable notifications: Add a subject, message, URL to open, and a command to execute.
- Timer support: Specify the delay using a human-readable format like
1h10m15s
. - Visual feedback: Option to run the reminder visually with a progress bar.
- Background execution: Option to run the reminder as a background process with logging.
- JSON output: Outputs reminder details in JSON format when running in background.
- Minimum time limit: Enforces a minimum time of 15 seconds for all reminders.
- Default messages: Provides friendly default messages if none specified.
- Logging: Stores background process logs in
~/.local/state/ywfm/
.
- Python 3.6 or later
tqdm
package for progress bar visualization
- macOS:
terminal-notifier
for notifications- Homebrew (recommended for installing dependencies)
- Linux:
notify-send
(libnotify-bin) for notificationsxdg-utils
for opening URLs
The installer script (install.py
) handles all dependencies and setup:
-
Clone or download the repository
-
Run the installer:
python3 install.py
The installer will:
- Check for missing system dependencies
- Prompt before installing any missing dependencies
- Install required Python packages
- Set up the executable in your PATH
Note: You may need:
- macOS: Homebrew installed (https://brew.sh)
- Linux: sudo privileges for package installation
-
The installer will guide you through adding the following to your PATH:
export PATH="$HOME/.local/bin:$PATH"
Add this to your shell config file (
~/.bashrc
,~/.zshrc
, etc.) for persistence.
Click to expand manual installation steps
-
Check system dependencies:
- macOS:
which terminal-notifier
- Linux:
which notify-send xdg-open
- macOS:
-
Check Python packages:
python3 -m pip show tqdm
-
macOS:
brew install terminal-notifier
-
Linux:
sudo apt update sudo apt install -y libnotify-bin xdg-utils
- Install required package:
python3 -m pip install --user tqdm
-
Create installation directory:
mkdir -p ~/.local/bin
-
Make script executable and install:
chmod +x main.py cp main.py ~/.local/bin/ywfm
-
Add to PATH (if not already added):
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc # or ~/.zshrc source ~/.bashrc # or ~/.zshrc
ywfm [-h] [-s SUBJECT] [-m MESSAGE] -t TIMER [-o OPEN_URL] [-c COMMAND] [-p] [-b]
Option | Description | Default |
---|---|---|
-s --subject |
Subject for the reminder notification | "ywfm" |
-m --message |
Message for the notification | Random* |
-t --timer |
Timer duration (e.g., 1h10m15s , 10s ) |
Required |
-o --open-url |
URL to open when notification triggers | None |
-c --command |
Command to execute after timer ends | None |
-p --show-progress |
Show progress bar | False |
-b --background |
Run as background process | False |
* Default messages alternate between "Well done!" and "You're welcome!"
-
Simple Reminder:
ywfm -t 30m -s "Time to Work" -m "Start your project"
-
Open URL on Timer:
ywfm -t 10s -s "Check GitHub" -m "Review PRs" -o "https://github.com"
-
Execute Command:
ywfm -t 1m -s "Build" -c 'make clean && make'
-
Background Process with Logging:
ywfm -t 2h -s "Long Task" -b
Output:
{ "pid": 12345, "main": { "subject": "Long Task", "message": "Well done!", "duration": "2h", "url": null, "command": null, "show-progress": false, "background": true, "created_at": "2024-03-21_14:30:00", "trigger_at": "2024-03-21_16:30:00" }, "extra": { "os_name": "Darwin", "machine": "x86_64", "node": "Sanghun.local", "platform": "macOS-14.7-x86_64-i386-64bit", "seconds": 7200, "description": "[INFO] Output and error message of background process are stored in '~/.local/state/ywfm'." } }
-
Progress Bar:
ywfm -t 10m -s "Break" -m "Coffee time!" -p
When running in background mode (-b
):
- Process ID (PID) is output in JSON format
- Logs are stored in
~/.local/state/ywfm/
:output_[timestamp].log
: Standard outputerror_[timestamp].log
: Error messagesywfm.pid
: Current process PID
To stop a background reminder:
kill $(cat ~/.local/state/ywfm/ywfm.pid)
-
Remove the executable:
rm ~/.local/bin/ywfm
-
Optional: Remove log directory:
rm -rf ~/.local/state/ywfm
-
Optional: Remove dependencies:
- macOS:
brew uninstall terminal-notifier
- Linux:
sudo apt remove libnotify-bin xdg-utils
- macOS:
Feel free to fork the repository and submit pull requests for improvements.
This project is licensed under the MIT License.
Sanghun Park
Thank you, past me.
Good job, future me.
Well done, past me.
You're welcome, future me.
Thanks a lot.