Files
waybar_time_track/README.md
T
fegger 94566aa820 Add Waybar time tracker with README, styles, and config
Includes a dependency-free Python CLI, Waybar JSON output, persistent
JSON storage, and Markdown timesheet generation grouped by project and
day. Also adds example Waybar configuration and CSS.
2026-09-02 12:29:01 +02:00

1.8 KiB

Waybar Time Tracker

A small, dependency-free Python time tracker for Waybar with a start/stop button and timesheet generation.

Features

  • Start / stop button in Waybar: click the module to toggle tracking.
  • Live elapsed time shown in the bar while running.
  • Persistent JSON storage in ~/.local/share/time_track/data.json (override with TIME_TRACK_DIR).
  • Timesheet generation in Markdown, grouped by project and by day.

Files

File Purpose
time_track.py Main CLI and Waybar interface
waybar-config.json Example Waybar custom module configuration
style.css Example CSS for the running/idle states

Installation

  1. Make sure time_track.py is executable:

    chmod +x /path/to/time_track/time_track.py
    
  2. Add the custom module from waybar-config.json to your Waybar config (~/.config/waybar/config).

  3. Add the CSS from style.css to your Waybar stylesheet (~/.config/waybar/style.css).

  4. Update the paths in waybar-config.json to point to wherever you place time_track.py.

CLI usage

# Toggle tracking for the default project
./time_track.py toggle

# Toggle tracking for a specific project
./time_track.py toggle "client-a"

# Emit Waybar JSON (used by the module)
./time_track.py status

# Show the active session
./time_track.py current

# Stop the active session
./time_track.py stop

# Show recent entries
./time_track.py log
./time_track.py log 25

# Generate a Markdown timesheet
./time_track.py timesheet week
./time_track.py timesheet month

Waybar behavior

  • Left click: start or stop the current session.
  • Right click: print the current week's Markdown timesheet to stdout (useful bound to a notification or terminal).
  • The module updates every 5 seconds while running.