Compare commits
3 Commits
d01338fd0a
...
8cd7d14a2c
| Author | SHA1 | Date | |
|---|---|---|---|
|
8cd7d14a2c
|
|||
|
355c92bd08
|
|||
|
5f73b13b2a
|
@@ -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"))
|
||||
)
|
||||
@@ -1,2 +1 @@
|
||||
(include "./statusbar.yuck")
|
||||
(include "./dashboard.yuck")
|
||||
|
||||
@@ -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"
|
||||
17
home-manager/progs/eww/config/scripts/currentWindow.sh
Executable file
17
home-manager/progs/eww/config/scripts/currentWindow.sh
Executable 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"
|
||||
@@ -1,55 +1,55 @@
|
||||
(defwindow statusbar
|
||||
:monitor 0
|
||||
:stacking "fg"
|
||||
:exclusive true
|
||||
:geometry (geometry
|
||||
:y "0.5%"
|
||||
:width "100%"
|
||||
:height "24px"
|
||||
:anchor "top center")
|
||||
(statusbar))
|
||||
:monitor 0
|
||||
:stacking "fg"
|
||||
:exclusive true
|
||||
:geometry (geometry
|
||||
:y "0.5%"
|
||||
:width "100%"
|
||||
:height "24px"
|
||||
:anchor "top center")
|
||||
(statusbar))
|
||||
|
||||
(defwidget statusbar []
|
||||
(centerbox
|
||||
(box :space-evenly false :halign 'start' :class 'padded'
|
||||
(window-title))
|
||||
(time)
|
||||
(box :space-evenly false :halign 'end' :class 'padded'
|
||||
(brightness-ctl)
|
||||
(brightness-ctl-opener)
|
||||
; (clipboard)
|
||||
(volume)
|
||||
(battery)
|
||||
(bluetooth)
|
||||
(wifi))))
|
||||
(box :space-evenly false :halign 'start' :class 'padded'
|
||||
(window-title))
|
||||
(time)
|
||||
(box :space-evenly false :halign 'end' :class 'padded'
|
||||
(brightness-ctl)
|
||||
(brightness-ctl-opener)
|
||||
; (clipboard)
|
||||
(volume)
|
||||
(battery)
|
||||
(bluetooth)
|
||||
(wifi))))
|
||||
|
||||
(defwidget cmd-slider [?symbol value command max color]
|
||||
(box :space-evenly false
|
||||
(label :text symbol :class "symbol")
|
||||
(scale
|
||||
:min 0 :max max
|
||||
:value value
|
||||
:round-digits 0
|
||||
:timeout "200ms"
|
||||
:onchange command)
|
||||
(label :text "${value}%" :class color)))
|
||||
(box :space-evenly false
|
||||
(label :text symbol :class "symbol")
|
||||
(scale
|
||||
:min 0 :max max
|
||||
:value value
|
||||
:round-digits 0
|
||||
:timeout "200ms"
|
||||
:onchange command)
|
||||
(label :text "${value}%" :class color)))
|
||||
|
||||
(defpoll windowtitle :interval "1s" `scripts/currentWindow.fish`)
|
||||
(defpoll windowtitle :interval "1s" `scripts/currentWindow.sh`)
|
||||
|
||||
(defwidget window-title []
|
||||
(label
|
||||
:text {windowtitle == "" ? "" : "(${windowtitle})"}))
|
||||
:text {windowtitle == "" ? "" : "(${windowtitle})"}))
|
||||
|
||||
(defwidget brightness-ctl []
|
||||
(box :visible brightnessctl-open
|
||||
(cmd-slider :symbol "" :value brightness
|
||||
:command `brightnessctl set {}%`
|
||||
:max 101 :color {
|
||||
brightness >= 80 ? "green" :
|
||||
brightness >= 50 ? "yellow" :
|
||||
brightness >= 30 ? "peach" :
|
||||
brightness >= 10 ? "maroon" : "red"
|
||||
})))
|
||||
(cmd-slider :symbol "" :value brightness
|
||||
:command `brightnessctl set {}%`
|
||||
:max 101 :color {
|
||||
brightness >= 80 ? "green" :
|
||||
brightness >= 50 ? "yellow" :
|
||||
brightness >= 30 ? "peach" :
|
||||
brightness >= 10 ? "maroon" : "red"
|
||||
})))
|
||||
|
||||
|
||||
(defpoll brightness :interval "1s" :run-while brightnessctl-open `brightnessctl -m | awk -F, '{print $4+0}'`)
|
||||
|
||||
Reference in New Issue
Block a user