22 lines
506 B
Bash
Executable file
22 lines
506 B
Bash
Executable file
#!/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
|