dotfiles/home/dot_config/eww/scripts/executable_get-workspaces.sh
2026-03-22 20:46:20 +08:00

14 lines
243 B
Bash

#!/bin/bash
# 需安裝 jq
get_workspaces() {
swaymsg -t get_workspaces | jq -c 'sort_by(.num)'
}
# 初始輸出
get_workspaces
# 監聽事件並更新
swaymsg -t subscribe '["workspace"]' -m | while read -r line; do
get_workspaces
done