blob: 5a2316fcb8c6cbe3d3a18edcde4ff44949e3d2a4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#!/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) ]"
echo "$PREFIX$(echo $[ $MINUTES * 100 / 1440 ] | sed 's/\..*//g')%"
}
get_daypercentage
|