Compare commits

...

3 Commits

Author SHA1 Message Date
8cd7d14a2c eww: fix currentWindow logic 2025-09-17 12:43:04 -04:00
355c92bd08 eww: delete dashboard 2025-09-17 12:16:33 -04:00
5f73b13b2a eww: format 2025-09-17 12:15:36 -04:00
5 changed files with 56 additions and 67 deletions

View File

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

View File

@@ -1,2 +1 @@
(include "./statusbar.yuck") (include "./statusbar.yuck")
(include "./dashboard.yuck")

View File

@@ -1,10 +0,0 @@
#!/usr/bin/env fish
name=$(niri msg focused-window | rg Title | sed -E "s/[[:space:]]+Title\: //g" | sed "s/\"//g")
proc_name=$(echo "$name" | head -c 55)
# TODO! fix this logic, add a '...' at the end
if ["$name" != "$proc_name"]
proc_name="$proc_name..."
end
echo "$proc_name"

View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
niri_data=$(niri msg --json focused-window)
if [[ "$niri_data" == "null" ]]; then
exit 0
fi
name=$(echo "$niri_data" | jq -r '.["app_id"], .["title"]' | tr '\n' ' ' | sed 's/.$//')
proc_name=$(echo "$name" | head -c 55)
# TODO! fix this logic, add a '...' at the end
if [[ "$name" != "$proc_name" ]]; then
proc_name="$proc_name..."
fi
echo "$proc_name"

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.sh`)
(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}'`)