dotfiles/home/r0r5chach/.config/eww/widgets/player/duration/duration

4 lines
206 B
Plaintext
Executable File

total=$(playerctl metadata | grep length | awk -v n=1000000 '{ printf "%.2f\n", $3/n }')
len=$(playerctl position)
perc=$( echo $len | awk -v total=$total '{ printf "%d\n", ($1 / total) * 100 }')
echo $perc