aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoni <toni@devlap.local>2015-05-17 20:28:21 +0200
committertoni <toni@devlap.local>2015-05-17 20:28:21 +0200
commit46d57fad0b8574ad1f790a2144f9172380967c3e (patch)
tree3000e6f6902c362b6f3b2ba5bdcf2d3e2aec99f2
parentd41bf82bb2d189fdebc7fa4958d2c01fada1afba (diff)
fixed msi stuff, added io usage
-rwxr-xr-xconfigs/xmobar_bat_msi.sh8
-rwxr-xr-xconfigs/xmobar_iostat.sh30
-rw-r--r--configs/xmobarrc_msi11
3 files changed, 40 insertions, 9 deletions
diff --git a/configs/xmobar_bat_msi.sh b/configs/xmobar_bat_msi.sh
index 9bb413f..cdaee43 100755
--- a/configs/xmobar_bat_msi.sh
+++ b/configs/xmobar_bat_msi.sh
@@ -3,12 +3,12 @@
echo -n "BAT:"
OUT=$(acpi -b | sed -n 's/Battery 0:\(.*\), \(.*\)%\(.*\)/\2/p')
-if [ $OUT -lt 80 ]; then
- echo "<fc=#00FF00>$OUT</fc>%"
+if [ $OUT -lt 10 ]; then
+ echo "<fc=#FF0000>$OUT</fc>%"
elif [ $OUT -lt 50 ]; then
echo "<fc=#FFFF00>$OUT</fc>%"
-elif [ $OUT -lt 10 ]; then
- echo "<fc=#FF0000>$OUT</fc>%"
+elif [ $OUT -lt 80 ]; then
+ echo "<fc=#00FF00>$OUT</fc>%"
else
echo "$OUT%"
fi
diff --git a/configs/xmobar_iostat.sh b/configs/xmobar_iostat.sh
new file mode 100755
index 0000000..662c21f
--- /dev/null
+++ b/configs/xmobar_iostat.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+OUT=$(dstat -dD total --noheaders --noupdate --integer 1 1 | tail -n 1)
+# | sed -n 's/^\s*\([0-9]*[[:alpha:]]*\).*$/__\1___/p'
+
+READ=$(echo $OUT | sed -n 's/^\s*\([0-9]*[[:alpha:]]*\).*$/\1/p')
+WRITE=$(echo $OUT | sed -n 's/^\s*[0-9]*[[:alpha:]]*\s*\([0-9]*[[:alpha:]]*\)$/\1/p')
+
+
+outio() {
+local lc
+lc=$(echo "$1" | cut -c $((${#1})))
+if [ $lc = "k" ]; then
+ echo -n '<fc=#FFFF00>'
+elif [ $lc = "B" ]; then
+ echo -n '<fc=#00FF00>'
+elif [ $lc = "M" ]; then
+ echo -n '<fc=#FF0000>'
+else
+ echo -n '<fc=#FFFFFF>'
+fi
+echo -n "${1}</fc>"
+}
+
+outio "${READ}"
+echo -n ' | '
+outio "${WRITE}"
+echo
+
+exit $?
diff --git a/configs/xmobarrc_msi b/configs/xmobarrc_msi
index 2ac3ce5..92889e0 100644
--- a/configs/xmobarrc_msi
+++ b/configs/xmobarrc_msi
@@ -4,18 +4,19 @@ Config { font = "-misc-fixed-*-*-*-*-18-*-*-*-*-*-*-*"
, borderColor = "black"
, fgColor = "grey"
, position = TopW L 100
- , commands = [ Run Com "~/.xmobar_cputemp.sh" ["CPU"] "ctmp" 100
- , Run Com "~/.xmobar_cputemp.sh" ["MB"] "mtmp" 100
- , Run Com "~/.xmobar_bat.sh" ["BAT"] "bat" 100
+ , commands = [ Run Com "./.xmobar_iostat.sh" ["IO"] "iost" 20
+ , Run Com "./.xmobar_cputemp.sh" ["CPU"] "ctmp" 100
+ , Run Com "./.xmobar_cputemp.sh" ["MB"] "mtmp" 100
+ , Run Com "./.xmobar_bat.sh" ["BAT"] "bat" 100
, Run Network "eth0" ["-L","0","-H","32","--normal","green","--high","red"] 20
, Run Network "wlan0" ["-L","0","-H","32","--normal","green","--high","red"] 20
, Run Cpu ["-L","15","-H","50","--normal","green","--high","red"] 20
, Run Memory ["Mem: %"] 200
, Run Swap [] 200
- , Run Date "%a %b (%V) %_d %Y %H:%M:%S" "date" 20
+ , Run Date "%a %b %_d %Y %H:%M (KW%V)" "date" 600
, Run StdinReader
]
, sepChar = "%"
, alignSep = "}{"
- , template = "%StdinReader% }{ %ctmp% %mtmp% | %cpu% | %bat% | %memory% | %eth0% | %wlan0% | %date%"
+ , template = "%StdinReader% }{ %iost% | %ctmp% %mtmp% | %cpu% | %bat% | %memory% | %eth0% | %wlan0% | %date%"
}