This proof of concept marks a running timer by placing a unix timestamp in a marker file. When a running timer is paused, the difference in seconds between the start time and now is saved to a 'splitx' file. Entries in the splits file are included in the final tally.
Inspired by a question on Reddit: https://www.reddit.com/r/linuxquestions/comments/d7am8l/timer_linked_to_conky_and_keyboard_button_that_is/
- Playing sounds requires
mpg123
to be installed. .mp3
files for sounds are not provided in this gist. If you need some short ones, consider taking a skim through https://github.com/adeutscher/audio-tools/tree/master/files.
- Start/Pause the timer by running
./toggle.sh
- Clear the timer by running
./reset.sh
- Since
reset.sh
deletes the splits and marker files, the timer is considered to be paused after it is reset.
- Since
- Display the number of seconds elapsed with
./display.sh
- Display a formatted version of the number of seconds elapsed with
./conky.sh
Using xbindkeys
to allow the toggle and reset scripts to be used globally without a terminal. The Arch Wiki was really helpful about the use of this command (https://wiki.archlinux.org/index.php/Xbindkeys).
Note that xbindkeys
is not installed by default, at least on Fedora.
I've included the xbindkeysrc
file with my configuration in this gist, but due to how I get to F11/F12 on my laptop your machine may be slightly different.
xbindkeys -f xbindkeysrc
To find the keycodes for a particular key, enter the following command:
xbindkeys --key
To run demo conky:
conky --config conkyrc
The conky configuration is a default config that's only had the scripting in the displayed content nudged.