mirror of
https://git.adityakumar.xyz/dwmbar.git
synced 2024-12-22 21:22:52 +00:00
Added daypercentage
This commit is contained in:
parent
48e494a6b8
commit
a37c7b0f4e
1 changed files with 13 additions and 0 deletions
13
modules/daypercentage
Executable file
13
modules/daypercentage
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Prints the percentage of the day that has been completed
|
||||
|
||||
PREFIX=' '
|
||||
|
||||
get_daypercentage()
|
||||
{
|
||||
MINUTES="$[$(date +%R | cut -d ':' -f1) * 60 + $(date +%R | cut -d ':' -f2) ]"
|
||||
echo "$PREFIX$(echo $[ $MINUTES * 100 / 1440 ] | sed 's/\..*//g')%"
|
||||
}
|
||||
|
||||
get_daypercentage
|
Loading…
Reference in a new issue