working on eww

This commit is contained in:
2026-03-11 19:38:24 +01:00
parent 1e40ebcc9a
commit 8b9973e7d3
2 changed files with 13 additions and 16 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
/* Catppuccin Mocha theme for EWW */
root {
:root {
--base: #1e1e2e;
--mantle: #181825;
--crust: #11111b;
+12 -15
View File
@@ -10,27 +10,25 @@
(label :class "workspace" :id "workspace_5" :text "5")
)
;; Center: Empty (placeholder for alignment)
(box :halign "center" :hexpand true)
;; Right: System modules
(box :class "right-items" :orientation "h" :spacing 8
;; Idle inhibitor
(button :class "idle-inhibitor" :onclick "eww update idle_inhibitor_icon=''; notify-send 'Idle inhibitor' 'Activated'"
:label (label :id "idle_inhibitor_icon" :text "󰒲"))
(button :class "idle-inhibitor" :onclick "eww update idle_inhibitor_icon='\uF472'; notify-send 'Idle inhibitor' 'Activated'"
:label (label :id "idle_inhibitor_icon" :text "\uF472"))
;; PulseAudio
(button :class "pulseaudio" :onclick "pavucontrol"
:label (label :id "pulseaudio_label" :text " 100%"))
:label (label :id "pulseaudio_label" :text "\uF028 100%"))
;; Network
(button :class "network" :onclick "impala" :onclick-right "nm-connection-editor"
:label (label :id "network_label" :text "Disconnected "))
:label (label :id "network_label" :text "Disconnected !"))
;; Battery
(button :class "battery" :label (label :id "battery_label" :text "100% 󰂄"))
(button :class "battery" :label (label :id "battery_label" :text "100% \uF0E4"))
;; Tray placeholder (requires external tray like waybar-tray)
(box :class "tray" :orientation "h" :spacing 4
@@ -57,15 +55,14 @@
(setq pulseaudio-volume (exec "pamixer --get-volume"))
(setq pulseaudio-muted (exec "pamixer --get-mute"))
(if (string= pulseaudio-muted "true")
(eww update pulseaudio_label="")
(eww update pulseaudio_label=(strfmt "{}% {}" pulseaudio-volume (if (> (string->number pulseaudio-volume) 50) "" "")))
(eww update pulseaudio_label="\uF026")
(eww update pulseaudio_label=(strfmt "{}% {}" pulseaudio-volume (if (> (string->number pulseaudio-volume) 50) "\uF028" "\uF027")))
;; Update network status
(setq network-essid (exec "nmcli -t -f TYPE,NAME dev status | awk -F: '/wifi/{print $2}' | xargs -I {} sh -c 'nmcli -t -f SIGNAL dev wifi list ifname {} | awk -F: \"NR==2{print \\$1}\"'"))
(setq network-essid (exec "nmcli -t -f TYPE,NAME dev status | awk -F: '/wifi/{print $2}'"))
(if (string-empty? network-essid)
(eww update network_label="Disconnected !eww reload
")
(eww update network_label=(strfmt "Wifi" network-essid)))
(eww update network_label="Disconnected !")
(eww update network_label=(strfmt "\uF1EB ({})" network-essid)))
;; Update clock
(eww update clock_label=(strftime "%a, %d %b %Y - %H:%M"))
@@ -74,6 +71,6 @@
(setq battery-capacity (exec "cat /sys/class/power_supply/BAT0/capacity"))
(setq battery-status (exec "cat /sys/class/power_supply/BAT0/status"))
(if (string= battery-status "Charging")
(eww update battery_label=(strfmt "{}% 󰂄" battery-capacity))
(eww update battery_label=(strfmt "{}% 󰁹" battery-capacity))
(eww update battery_label=(strfmt "{}% \uF0E4" battery-capacity))
(eww update battery_label=(strfmt "{}% \uF079" battery-capacity)))
)