Another project to pretend you're productive
- Go 1.21 or later
- Terminal with color support
git clone https://github.com/elxgy/work-timer
cd timergo mod tidygo build -o timer timer.goChoose one of the following methods:
# Move to system PATH
sudo mv timer /usr/local/bin/timer
sudo chmod +x /usr/local/bin/timerNow you can use timer from anywhere in your terminal!
For Bash (add to ~/.bashrc or ~/.bash_profile):
echo 'alias timer="/path/to/your/clone/timer"' >> ~/.bashrc
source ~/.bashrcFor Zsh (add to ~/.zshrc):
echo 'alias timer="/path/to/your/timer/timer"' >> ~/.zshrc
source ~/.zshrcFor Fish (add to ~/.config/fish/config.fish):
echo 'alias timer="/path/to/your/timer/timer"' >> ~/.config/fish/config.fish
source ~/.config/fish/config.fish# Add to your shell config file
alias timer="cd /path/to/your/timer/directory && go run timer.go"Simply run:
timerWhen you start the timer, you'll see:
Timer
Choose an option:
1 / w → Work session (30 minutes)
2 / b → Break session (10 minutes)
3 / a → Auto cycle (work → break → work...)
q → Quit
Space- Pause/resume timers- Skip current session(auto mode only)q- Quit applicationr- Return to main menu (when session is complete)
You can modify the session durations in timer.go:
const (
workDuration = 30 * time.Minute // Change work duration
breakDuration = 10 * time.Minute // Change break duration
)Rebuild after changes
- Bubble Tea - TUI framework
- Bubbles - UI components
- Lipgloss - Styling