dotfiles/homes/x86_64-linux/christopher@cobalt/fixtures/eww/scripts/get-active-workspace
Christopher Mühl 786af32daf
Publish my config
This is the result of ~100 commits to my NixOS config. Since I haven't
always used `agenix-rekey`, this is another initial commit so that none
of the secrets in my git history are leaked
2025-07-30 23:36:39 +02:00

23 lines
449 B
Bash
Executable file

#!/usr/bin/env bash
MONITOR=$1
if [ -z "$MONITOR" ]; then
echo "Usage: $0 <monitor>"
exit 1
fi
PREFIX="$MONITOR"
if [ "$MONITOR" == 0 ]; then
PREFIX=""
fi
# Output the currently selected workspace
workspace () {
hyprctl monitors -j | jq ".[] | select(.id == $MONITOR) | .activeWorkspace.id"
}
workspace
socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
workspace
done