added druckerguthaben in cip

This commit is contained in:
Sheppy
2017-02-17 00:34:56 +01:00
parent 1d12eb131d
commit 8c6fbf602b

View File

@@ -119,12 +119,16 @@ hc pad $monitor $panel_height
# small adjustments # small adjustments
#powersupply #powersupply
pwr="STATIC POWERSUPPLY" pwr="NO BATTERY"
if [ $HOSTNAME == atlantislaptop ] || [$HOSTNAME == atlantismedion ] ; then if [ $HOSTNAME == atlantislaptop ] || [$HOSTNAME == atlantismedion ] ; then
pwr="$(acpi -b | sed -r 's/Battery [0-9]+: //')" pwr="$(acpi -b | sed -r 's/Battery [0-9]+: //')"
fi fi
pracct=""
if [ $HOSTNAME~="faui*" ]; then
pracct="$(pr_acct | head -n 1 | sed -r 's/.*: //' | sed -r 's/\x1b\[[0-9]+m//' | sed -r 's/\x1b\[[0-9]+m//')"
fi
right="^fg(#ff0000) $pwr $separator^bg() $date $separator" right="^fg(#32CD32) Druckerguthaben: $pracct Euro^bg() ^fg(#ff0000) $pwr $separator^bg() $date $separator"
right_text_only=$(echo -n "$right" | sed 's.\^[^(]*([^)]*)..g') right_text_only=$(echo -n "$right" | sed 's.\^[^(]*([^)]*)..g')
# get width of right aligned text.. and add some space.. # get width of right aligned text.. and add some space..
width=$($textwidth "$font" "$right_text_only ") width=$($textwidth "$font" "$right_text_only ")