caelestia/hypr/scripts/track-time.fish
Carlos Fernandez Lockward 80f2d90435 Fix No active player error!
2025-06-19 00:03:06 -04:00

10 lines
347 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 mpris getActive position)
set -l length (caelestia shell mpris getActive length)
test $position != 'No media' -a $position != 'No active player' && echo "$(fmt-time $position)/$(fmt-time $length)"