pointfichiers/bar/eww/scripts/hypr/hyprstatus

23 lines
506 B
Text
Raw Normal View History

2024-09-20 18:45:02 +02:00
#!/usr/bin/env dash
spaces (){
hyprctl workspaces -j | jq -c 'map({id: .id, windows: .windows, monitor: .monitorID}) | sort_by(.id)'
}
current (){
hyprctl monitors -j | jq '.[] | select(.focused) | .activeWorkspace.id'
}
title (){
hyprctl activewindow -j | jq .title
}
status (){
echo "{\"spaces\": $(spaces), \"current\": $(current), \"title\": $(title)}"
}
status
socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
status
done