dwmbar/modules/daypercentage

14 lines
303 B
Text
Raw Normal View History

2019-10-21 20:23:19 +00:00
#!/bin/bash
# Prints the percentage of the day that has been completed
PREFIX=' '
get_daypercentage()
{
MINUTES="$[$(date +%R | cut -d ':' -f1 | sed 's/^0*//') * 60 + $(date +%R | cut -d ':' -f2) ]"
2019-10-21 20:23:19 +00:00
echo "$PREFIX$(echo $[ $MINUTES * 100 / 1440 ] | sed 's/\..*//g')%"
}
get_daypercentage