pointfichiers/bar/eww/scripts/hypr/hyprstatus

23 lines
507 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 --raw-output .title
}
status (){
echo "{\"spaces\": $(spaces), \"current\": \"$(current)\", \"title\": \"$(title)\"}"
}
status
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
status
done