pointfichiers/bar/eww/scripts/hypr/hyprstatus

23 lines
498 B
Text
Raw Normal View History

#!/bin/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