[eww] Adds my Eww config
This commit is contained in:
21
home-manager/apps/eww/config/scripts/active-workspace.sh
Executable file
21
home-manager/apps/eww/config/scripts/active-workspace.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
handle_event() {
|
||||
case $1 in
|
||||
focusedmon*) active_workspace;;
|
||||
workspace*) active_workspace;;
|
||||
esac
|
||||
}
|
||||
|
||||
active_workspace() {
|
||||
hyprctl activeworkspace -j | jq --compact-output --monochrome-output '{ id, name, monitor, has_windows: (.lastwindowtitle != "") }'
|
||||
}
|
||||
|
||||
# Run it once before any events come in.
|
||||
active_workspace
|
||||
|
||||
# Then listen for events
|
||||
socat -U - "UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" | while read -r event; do handle_event "$event"; done
|
||||
Reference in New Issue
Block a user