mirror of
https://github.com/zoriya/flake.git
synced 2026-06-12 06:41:27 +00:00
Add wifi and bluethooth
This commit is contained in:
@@ -14,6 +14,10 @@
|
||||
color: $base0C;
|
||||
}
|
||||
|
||||
.secondary {
|
||||
background-color: $base0E;
|
||||
color: $base00;
|
||||
}
|
||||
.secondary-txt {
|
||||
color: $base0E;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)))))
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user