94566aa82078d6ed6a5ceea3e0fc21a7b7103d17
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.
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 withTIME_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
-
Make sure
time_track.pyis executable:chmod +x /path/to/time_track/time_track.py -
Add the custom module from
waybar-config.jsonto your Waybar config (~/.config/waybar/config). -
Add the CSS from
style.cssto your Waybar stylesheet (~/.config/waybar/style.css). -
Update the paths in
waybar-config.jsonto point to wherever you placetime_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.
Description
Languages
Python
97.9%
CSS
2.1%