dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit defeb1361b58d8852263edc109d60a102b97d8ff
parent 95cbbb06e4d0493c7b2af626c122e63c2fff8001
Author: Janis Pagel <janis.pagel@ims.uni-stuttgart.de>
Date:   Fri, 13 Jul 2018 14:09:18 +0200

Improve dwm status bar

Battery is now only displayed if not full and temperatur only if above
100.

Diffstat:
Mxinitrc | 17+++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/xinitrc b/xinitrc @@ -42,12 +42,21 @@ do LOCALTIME=$(TZ=Europe/Berlin date +%Z\=%Y-%m-%dW%V%a%H:%M:%S) UTC="("$(TZ=UTC date +%Z\=%Y-%m-%dW%V%a%H:%M:%S)")" IP="IP=$(for i in `ip r`; do echo $i; done | grep -A 1 src | tail -n1)" - TEMP="Temp=$(($(cat /sys/class/thermal/thermal_zone0/temp) / 1000))°C" + if [ $(($(cat /sys/class/thermal/thermal_zone0/temp) / 1000)) -ge 100 ] + then + TEMP="Temp=$(($(cat /sys/class/thermal/thermal_zone0/temp) / 1000))°C" + else + TEMP="" + fi VERSION=$(echo 'dwm-6.1') # dwm -v does not work :( - BAT="Bat=$(acpi -b | awk '{ print $4 " " }' | tr -d ',' | tr -d ' ')" - + if [ "$(acpi -b | awk '{ print $3 " " }' | tr -d ',' | tr -d ' ')" != "Full" ] + then + BAT="Bat=$(acpi -b | awk '{ print $4 " " }' | tr -d ',' | tr -d ' ')" + else + BAT="" + fi xsetroot -name "$IP $VOL $BAT $TEMP $LOCALTIME $VERSION" - sleep 1s + sleep 0.1s done & # Call conky depending on window manager