eww: format

This commit is contained in:
Simon Gardling 2025-09-17 12:15:36 -04:00
parent d01338fd0a
commit 5f73b13b2a
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D
2 changed files with 49 additions and 49 deletions

View File

@ -1,17 +1,17 @@
(defwindow dashboard (defwindow dashboard
:monitor 0 :monitor 0
:stacking "bg" :stacking "bg"
:exclusive false :exclusive false
:geometry (geometry :geometry (geometry
:y "50%" :y "50%"
:x "50%" :x "50%"
:width "20%" :width "20%"
:height "20%" :height "20%"
)(dashboard)) )(dashboard))
(defwidget dashboard [] (defwidget dashboard []
(box (box
(label :text "hi")) (label :text "hi"))
) )

View File

@ -1,55 +1,55 @@
(defwindow statusbar (defwindow statusbar
:monitor 0 :monitor 0
:stacking "fg" :stacking "fg"
:exclusive true :exclusive true
:geometry (geometry :geometry (geometry
:y "0.5%" :y "0.5%"
:width "100%" :width "100%"
:height "24px" :height "24px"
:anchor "top center") :anchor "top center")
(statusbar)) (statusbar))
(defwidget statusbar [] (defwidget statusbar []
(centerbox (centerbox
(box :space-evenly false :halign 'start' :class 'padded' (box :space-evenly false :halign 'start' :class 'padded'
(window-title)) (window-title))
(time) (time)
(box :space-evenly false :halign 'end' :class 'padded' (box :space-evenly false :halign 'end' :class 'padded'
(brightness-ctl) (brightness-ctl)
(brightness-ctl-opener) (brightness-ctl-opener)
; (clipboard) ; (clipboard)
(volume) (volume)
(battery) (battery)
(bluetooth) (bluetooth)
(wifi)))) (wifi))))
(defwidget cmd-slider [?symbol value command max color] (defwidget cmd-slider [?symbol value command max color]
(box :space-evenly false (box :space-evenly false
(label :text symbol :class "symbol") (label :text symbol :class "symbol")
(scale (scale
:min 0 :max max :min 0 :max max
:value value :value value
:round-digits 0 :round-digits 0
:timeout "200ms" :timeout "200ms"
:onchange command) :onchange command)
(label :text "${value}%" :class color))) (label :text "${value}%" :class color)))
(defpoll windowtitle :interval "1s" `scripts/currentWindow.fish`) (defpoll windowtitle :interval "1s" `scripts/currentWindow.fish`)
(defwidget window-title [] (defwidget window-title []
(label (label
:text {windowtitle == "" ? "" : "(${windowtitle})"})) :text {windowtitle == "" ? "" : "(${windowtitle})"}))
(defwidget brightness-ctl [] (defwidget brightness-ctl []
(box :visible brightnessctl-open (box :visible brightnessctl-open
(cmd-slider :symbol "󰃠" :value brightness (cmd-slider :symbol "󰃠" :value brightness
:command `brightnessctl set {}%` :command `brightnessctl set {}%`
:max 101 :color { :max 101 :color {
brightness >= 80 ? "green" : brightness >= 80 ? "green" :
brightness >= 50 ? "yellow" : brightness >= 50 ? "yellow" :
brightness >= 30 ? "peach" : brightness >= 30 ? "peach" :
brightness >= 10 ? "maroon" : "red" brightness >= 10 ? "maroon" : "red"
}))) })))
(defpoll brightness :interval "1s" :run-while brightnessctl-open `brightnessctl -m | awk -F, '{print $4+0}'`) (defpoll brightness :interval "1s" :run-while brightnessctl-open `brightnessctl -m | awk -F, '{print $4+0}'`)