; for unicode symbols: https://jrgraphix.net/r/Unicode/E000-F8FF ; VARIABLES (defvar GB 1024000000) (defvar MB 1024000) ; DATE + TIME (defpoll time :interval "5s" :initial "" `date +%H:%M`) (defpoll date :interval "60s" :initial "" `date "+%A | %m-%d-%+4Y"`) (defwidget datetime [] (eventbox :tooltip date (label :class "text time" :text time) )) ; CPU (defwidget cpu [] (box :active true :tooltip "${round(EWW_CPU.cores[0].freq/1000,2)} GHz" (label :class "cpu_text" :text " ${round(EWW_CPU.avg,0)}%") ) ) ; MEMORY (defwidget mem [] (box :active true :tooltip {EWW_RAM.used_mem / GB < 1 ? "${round(EWW_RAM.used_mem / MB, 1)} M used" : "${round(EWW_RAM.used_mem / GB, 1)} G used"} (label :class "mem_text" :text " ${round(EWW_RAM.used_mem_perc,0)}%") ) ) ; TEMP ; TODO temperature widget (hover to show all times sorted nicely) ;  ; NETWORK (defpoll hostname :interval "1m" :initial "" "hostname") (defpoll status-icon :interval "5s" :initial "" "./widgets/resources/network.sh") (defwidget network [] (eventbox :active true :onclick "/usr/bin/env nm-connection-editor &" :tooltip hostname (label :text status-icon :class "network_icon"))) ; BLUETOOTH (defwidget bluetooth [] (eventbox :active true :onclick "blueman-manager &" (label :text "" :class "bluetooth_icon"))) ; VOLUME (defpoll volume_percent :interval "0.1s" :initial "40" "wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk -F. '{print $2}'") (defwidget volume [] (eventbox :active true :onclick "/usr/bin/env pavucontrol &" :onscroll "if [ {} = 'up' ]; then wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+; else wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%-; fi" (box :space-evenly false :orientation "h" :spacing "3" (label :class "volume_text" :text "${volume_percent <= 33 ? "" : volume_percent <= 66 ? "" : ""} ${volume_percent}%") ))) ; TODO add mic widget