Created
November 20, 2025 22:35
-
-
Save Dregu/e0704557866fc233dd10a9c14423c5c5 to your computer and use it in GitHub Desktop.
hyprland socket2 bash example template thing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| function handle { | |
| EVENT=${1%%\>\>*} | |
| DATA=${1#*\>\>} | |
| case $EVENT in | |
| activewindow) | |
| IFS=, read -r CLASS TITLE <<< "$DATA" | |
| echo "Window focused | Class: $CLASS | Title: $TITLE" | |
| ;; | |
| focusedmonv2) | |
| IFS=, read -r MON WS <<< "$DATA" | |
| echo "Monitor focused v2 | Monitor: $MON | Workspace: $WS" | |
| ;; | |
| *) | |
| echo "Unhandled event | Name: $EVENT | Data: $DATA" | |
| ;; | |
| esac | |
| } | |
| socat -u unix-connect:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock stdout | while read -r line; do handle "$line"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment