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

View file

@ -2,6 +2,7 @@
status=$(nmcli g | grep -oE "disconnected") status=$(nmcli g | grep -oE "disconnected")
essid=$(nmcli -t -f active,ssid dev wifi | grep '^yes' | cut -d: -f2) 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 if [ $status ] ; then
icon="睊" icon="睊"
@ -9,9 +10,15 @@ if [ $status ] ; then
col="#575268" col="#575268"
else else
if [ $device == "enp0s31f6" ]; then
icon=""
text="ethernet"
col="#a1bdce"
else
icon="" icon=""
text="${essid}" text="${essid}"
col="#a1bdce" col="#a1bdce"
fi
fi fi