Add disk usage script to bar

This commit is contained in:
Wiktor Zykubek 2020-05-10 13:33:06 +02:00
parent 2e8e96a7a0
commit 8987de0516
2 changed files with 13 additions and 1 deletions

View File

@ -5,7 +5,8 @@ sym="|"
cd "$HOME/.local/bin/scripts/dwmbar/" || exit 1
status() {
echo "$(./internet) $sym $(./lamp) $sym $(./music) $sym $(./alsa) $sym $(./packages) $sym $(./date) $sym $(./clock)"
echo "$(./disk) $sym $(./internet) $sym $(./lamp) $sym $(./music) $sym" \
"$(./alsa) $sym $(./packages) $sym $(./date) $sym $(./clock)"
}
while :; do

11
.local/bin/scripts/dwmbar/disk Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
used() {
df -h "$1" | awk 'NR==2 { print $3 "/" $4 " GB" }' | sed 's/G\//\//g;s/G / /g'
}
root="$(used /)"
home="$(used /home)"
echo ""
echo "/ $root,  $home"