From 8987de0516cd517884d33adfae3340413db9131e Mon Sep 17 00:00:00 2001 From: Wiktor Zykubek Date: Sun, 10 May 2020 13:33:06 +0200 Subject: [PATCH] Add disk usage script to bar --- .local/bin/scripts/dbar | 3 ++- .local/bin/scripts/dwmbar/disk | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 .local/bin/scripts/dwmbar/disk diff --git a/.local/bin/scripts/dbar b/.local/bin/scripts/dbar index f286dcc..da9c1c8 100755 --- a/.local/bin/scripts/dbar +++ b/.local/bin/scripts/dbar @@ -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 diff --git a/.local/bin/scripts/dwmbar/disk b/.local/bin/scripts/dwmbar/disk new file mode 100755 index 0000000..8ea37a3 --- /dev/null +++ b/.local/bin/scripts/dwmbar/disk @@ -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"