ref: improve eww get-active-workspace for multimonitor setup (#222)

This commit is contained in:
Pierrick Guillaume 2023-05-18 17:31:58 +02:00 committed by GitHub
parent 105b55239e
commit 9a8e8dc32d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -142,9 +142,12 @@ fi
### `~/.config/eww/scripts/get-active-workspace`
```sh
#!/bin/bash
hyprctl monitors -j | jq --raw-output .[0].activeWorkspace.id
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | stdbuf -o0 awk -F '>>|,' '/^workspace>>/{print $2}'
#!/usr/bin/env bash
hyprctl monitors -j | jq '.[] | select(.focused) | .activeWorkspace.id'
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - |
stdbuf -o0 awk -F '>>|,' -e '/^workspace>>/ {print $2}' -e '/^focusedmon>>/ {print $3}'
```
### `~/.config/eww/scripts/get-workspaces`