Skip to content

elxgy/work-timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

work-timer

Another project to pretend you're productive

Prerequisites

  • Go 1.21 or later
  • Terminal with color support

Installation

1. Clone or Download

git clone https://github.com/elxgy/work-timer
cd timer

2. Install Dependencies

go mod tidy

3. Build the Executable

go build -o timer timer.go

4. Set Up Terminal Alias

Choose one of the following methods:

Option A: Global Installation (Recommended)

# Move to system PATH
sudo mv timer /usr/local/bin/timer
sudo chmod +x /usr/local/bin/timer

Now you can use timer from anywhere in your terminal!

Option B: Shell Alias

For Bash (add to ~/.bashrc or ~/.bash_profile):

echo 'alias timer="/path/to/your/clone/timer"' >> ~/.bashrc
source ~/.bashrc

For Zsh (add to ~/.zshrc):

echo 'alias timer="/path/to/your/timer/timer"' >> ~/.zshrc
source ~/.zshrc

For Fish (add to ~/.config/fish/config.fish):

echo 'alias timer="/path/to/your/timer/timer"' >> ~/.config/fish/config.fish
source ~/.config/fish/config.fish

Option C: Direct Go Run Alias

# Add to your shell config file
alias timer="cd /path/to/your/timer/directory && go run timer.go"

Usage

Starting the Timer

Simply run:

timer

Main Menu Options

When 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

During Timer Session:

  • Space - Pause/resume timer
  • s - Skip current session(auto mode only)
  • q - Quit application
  • r - Return to main menu (when session is complete)

Customization

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

Dependencies

License

MIT License

About

Another project to pretend you're productive

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages