caelestia/scripts/track-time.fish
2025-03-02 23:53:21 +11:00

10 lines
292 B
Fish
Executable file

#!/bin/fish
function fmt-time -a secs
printf "%d:%02d" (math -s 0 $secs / 60 % 60) (math -s 0 $secs % 60)
end
set -l position (caelestia shell media position)
set -l length (caelestia shell media length)
test $position != 'No media' && echo "$(fmt-time $position)/$(fmt-time $length)"