diff --git a/modules/home/eww/eww.scss b/modules/home/eww/eww.scss index 46571f5..0f1b91b 100644 --- a/modules/home/eww/eww.scss +++ b/modules/home/eww/eww.scss @@ -14,6 +14,10 @@ color: $base0C; } +.secondary { + background-color: $base0E; + color: $base00; +} .secondary-txt { color: $base0E; } diff --git a/modules/home/eww/pannel/scss/_stats.scss b/modules/home/eww/pannel/scss/_stats.scss index 78bfd45..6d55c48 100644 --- a/modules/home/eww/pannel/scss/_stats.scss +++ b/modules/home/eww/pannel/scss/_stats.scss @@ -1,3 +1,9 @@ +.disclose-big-button { + font-size: 15; + border-radius: 2em; + padding: 16px 0; +} + .disclose-stats-box { background-color: $base01; border-radius: 3em; diff --git a/modules/home/eww/pannel/yuck/_env.yuck b/modules/home/eww/pannel/yuck/_env.yuck index db57601..415ed72 100644 --- a/modules/home/eww/pannel/yuck/_env.yuck +++ b/modules/home/eww/pannel/yuck/_env.yuck @@ -1,6 +1,3 @@ -(defpoll net :interval "100s" `nmcli -terse -fields SIGNAL,ACTIVE device wifi | awk --field-separator ':' '{if($2=="yes")print$1}'`) -(defpoll ssid :interval "100s" `nmcli -terse -fields SSID,ACTIVE device wifi | awk --field-separator ':' '{if($2=="yes")print$1}'`) - ; REAL THINGS (defpoll disclose_stats :interval "5s" "./src/shell/logger.py stats") (deflisten disclose_sub "./src/shell/combine.bash sub") diff --git a/modules/home/eww/pannel/yuck/_init.yuck b/modules/home/eww/pannel/yuck/_init.yuck index 27ff78f..1b53875 100644 --- a/modules/home/eww/pannel/yuck/_init.yuck +++ b/modules/home/eww/pannel/yuck/_init.yuck @@ -9,11 +9,11 @@ (include "./pannel/yuck/_music.yuck") (include "./pannel/yuck/_layout.yuck") -(defwindow disclose :stacking "fg" +(defwindow pannel :stacking "fg" :windowtype "normal" :wm-ignore true :monitor 0 :geometry (geometry :width "26%" :height "100%" :anchor "right bottom") - (disclose_layout)) + (pannel_layout)) ;; vim:ft=yuck diff --git a/modules/home/eww/pannel/yuck/_layout.yuck b/modules/home/eww/pannel/yuck/_layout.yuck index f7b6063..9171260 100644 --- a/modules/home/eww/pannel/yuck/_layout.yuck +++ b/modules/home/eww/pannel/yuck/_layout.yuck @@ -1,4 +1,4 @@ -(defwidget disclose_layout [] +(defwidget pannel_layout [] (box :class "disclose-closer" (box :orientation "vertical" :space-evenly false @@ -15,8 +15,9 @@ :vexpand true :hexpand true :class "disclose-scroll" - (literal :content "toto")) + (literal :content disclose_sub)) (label :class "disclose-separator" :text "") + (wifi) (box :space-evenly false :class "disclose-misc-box" (dstats) (dmusic))))) diff --git a/modules/home/eww/pannel/yuck/_stats.yuck b/modules/home/eww/pannel/yuck/_stats.yuck index 0719679..5cda030 100644 --- a/modules/home/eww/pannel/yuck/_stats.yuck +++ b/modules/home/eww/pannel/yuck/_stats.yuck @@ -1,6 +1,10 @@ ; TODO: Update this value when pressing the button. (defpoll bright :interval '5s' "brightnessctl -m | cut -d , -f 4 | head -c -2") +(defpoll ssid :interval "5s" `nmcli -terse -fields SSID,ACTIVE device wifi | awk --field-separator ':' '{if($2=="yes")print$1}'`) +(defpoll bluethooth :interval '5s' "echo info | timeout 1 bluetoothctl | grep 'Name'") + + (defwidget stat_card [icon name percent value colorClass] (box :space-evenly false :class "disclose-stats-box" @@ -13,7 +17,6 @@ (label :halign "center" :class "info-value ${colorClass}-txt" :text value) (label :halign "start" :class "info-label" :text name)))) -; (defwidget dstats [] (box :space-evenly false :orientation "vertical" @@ -23,4 +26,19 @@ (stat_card :icon "" :name "Memory" :percent {EWW_RAM.used_mem_perc} :value "${round(EWW_RAM.used_mem_perc, 0)}%" :colorClass "green") (stat_card :icon "󰃠" :name "Brightness" :percent bright :value "${bright}%" :colorClass "blue"))) + +(defwidget wifi [] + (box + :class "module" + :spacing 16 + :style "margin: 8px 16px 16px 16px" + (button + :class "accent disclose-big-button" + :click "nm-connection-editor" + "直 : ${ssid != "" ? ssid : "Disconnected"}") + (button + :class "secondary disclose-big-button" + :onclick "blueberry" + " : ${bluethooth != "" ? bluethooth : 'Disconnected'}"))) + ;; vim:filetype=yuck