adding conditionals for battery, brightness, and wifi

This commit is contained in:
Chris Cochrun 2022-12-21 09:49:02 -06:00
parent 2c7d2c04c6
commit b07358f12e
2 changed files with 14 additions and 4 deletions

View file

@ -14,6 +14,7 @@
(defpoll COL_WLAN :interval "1m" "scripts/wifi --COL")
(defpoll ESSID_WLAN :interval "1m" "scripts/wifi --ESSID")
(defpoll WLAN_ICON :interval "1m" "scripts/wifi --ICON")
(defpoll HOST :interval "1h" "hostname")
(deflisten workspace "scripts/workspace")
(deflisten appname "scripts/appname")
@ -65,6 +66,7 @@
(eventbox
:onhover "${EWW_CMD} update br_reveal=true"
:onhoverlost "${EWW_CMD} update br_reveal=false"
:visible {HOST == "kaladin" ? "false" : "true"}
(box
:class "module"
:space-evenly "false"
@ -131,6 +133,7 @@
:vexpand "false"
:hexpand "false"
:spacing 5
:visible {HOST == "kaladin" ? "false" : "true"}
(circular-progress
:value {EWW_BATTERY["BAT1"].capacity}
:class "batbar"
@ -263,7 +266,7 @@
(sep)
(cpu)
(mem)
(EWW_BATTERY["BAT1"].capacity ? (bat) : ())
(bat)
(sep)
(notif_button)))

View file

@ -2,17 +2,24 @@
status=$(nmcli g | grep -oE "disconnected")
essid=$(nmcli -t -f active,ssid dev wifi | grep '^yes' | cut -d: -f2)
device=$(nmcli d | rg -w "connected" | awk '{print $1}')
if [ $status ] ; then
icon="睊"
text=""
col="#575268"
else
if [ $device == "enp0s31f6" ]; then
icon=""
text="ethernet"
col="#a1bdce"
else
icon=""
text="${essid}"
col="#a1bdce"
fi
fi
case $1 in