From 206b6cc9dac3f13ef59aa01981a24439478c3236 Mon Sep 17 00:00:00 2001 From: Mattia Basaglia Date: Sun, 11 Jan 2015 19:42:13 +0100 Subject: [PATCH] Option to choose filesystem type --- systempony | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/systempony b/systempony index 1e8be88..9923c3b 100755 --- a/systempony +++ b/systempony @@ -1,7 +1,12 @@ #!/bin/bash +# These global variables can be overridden by config +# Name of the pony PONY=random +# What info to show (must have a function defined as ponyget_* to work) INFO=( User Hostname Distro Kernel Uptime Shell Packages RAM Disk ) +# File system type to show disk usage (default/empty=all) (see df for specific values) +FSTYPE= function ponyget_Shell() { @@ -82,7 +87,9 @@ function ponyget_Packages() function ponyget_Disk() { - local diskusage=$(df -lh --total | tail -n 1 | sed -r "s/ +/\t/g" ) + local dfoption=$FSTYPE + [ "$dfoption" ] && dfoption="-t $FSTYPE" + local diskusage=$(df -lh $dfoption --total | tail -n 1 | sed -r "s/ +/\t/g" ) local used=$(echo "$diskusage" | cut -f 3) local total=$(echo "$diskusage" | cut -f 2) local percent=$(echo "$diskusage" | cut -f 5 | sed s/%// )