Tuxtimer – Integratable terminal stopwatch
In the last few days, schitzu and I wrote a new stopwatch script in Bash. It simply prints ongoing time in hours, minutes and seconds format. Running the same script again in a separate process, pauses the timer. Running ./sw --stop
resets it. The output format is in Json, so you can use it in third-party apps.
Personally I use this module in the Wayland statusbar Waybar as a custom module. The configuration part will look like this:
[...]
"custom/stopwatch": {
"format": " {} ",
"exec": "~/.config/waybar/sw",
"on-click": "~/.config/waybar/sw",
"on-click-right": "~/.config/waybar/sw --stop",
"return-type": "json"
}
[...]
You have to adapt the paths to the executable script above. The stopwatch script itself is available here inside my NixOS configuration repository.