diff options
author | toni <toni@devlap.local> | 2015-05-17 20:28:21 +0200 |
---|---|---|
committer | toni <toni@devlap.local> | 2015-05-23 15:41:11 +0200 |
commit | 33065198fb9eed8938c189f6f87f6c15edd52fe6 (patch) | |
tree | 957b2fb5b7391d4bbf8e01fc187135b91cea61fd /configs | |
parent | d41bf82bb2d189fdebc7fa4958d2c01fada1afba (diff) |
fixed msi stuff, added io usage
Diffstat (limited to 'configs')
-rwxr-xr-x | configs/xmobar_bat_msi.sh | 8 | ||||
-rwxr-xr-x | configs/xmobar_iostat.sh | 30 | ||||
-rwxr-xr-x | configs/xmobar_iostat_msi.sh | 35 | ||||
-rw-r--r-- | configs/xmobarrc_msi | 11 |
4 files changed, 75 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/xmobar_iostat_msi.sh b/configs/xmobar_iostat_msi.sh new file mode 100755 index 0000000..efcd1fe --- /dev/null +++ b/configs/xmobar_iostat_msi.sh @@ -0,0 +1,35 @@ +#!/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') +BAT=$(cat /sys/class/power_supply/ADP1/online) + + +outio() { +local lc +if [ $BAT -ne 1 ]; then + echo "[DISABLED]" + exit 0 +fi +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%" } |