2024-01-17 15:33:46 +07:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
|
|
|
|
|
out () {
|
2024-01-27 13:52:10 +07:00
|
|
|
if [ -z "$1" ] || [ "$1" == "null" ]; then
|
2024-01-17 15:33:46 +07:00
|
|
|
echo ""
|
|
|
|
|
else
|
|
|
|
|
echo "(box :class \"widget title\" :halign \"center\" :valign \"center\" :vexpand true :hexpand true (label :text \"$1\"))"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
init=$(hyprctl activewindow -j | jq --raw-output .title)
|
2025-03-15 22:36:14 +11:00
|
|
|
trunc=$(echo $init | cut -c-60)
|
|
|
|
|
out "$trunc"
|
2024-01-17 15:33:46 +07:00
|
|
|
|
2024-07-02 09:51:31 +10:00
|
|
|
socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | stdbuf -o0 awk -F '>>|,' '/^activewindow>>/{print $3}' | while read -r line ; do
|
2025-03-15 22:36:14 +11:00
|
|
|
trunc=$(echo $line | cut -c-60)
|
2024-01-17 15:33:46 +07:00
|
|
|
out "$trunc"
|
|
|
|
|
done
|