eww: fix currentWindow logic
This commit is contained in:
parent
355c92bd08
commit
8cd7d14a2c
@ -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"
|
||||||
@ -34,7 +34,7 @@
|
|||||||
: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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user