🐛 (neodymium/home) fix eww script to get workspaces, now requires workspaces to be sorted

This commit is contained in:
Laureηt 2023-10-18 17:19:17 +02:00
parent 424f4f151d
commit af6ab87de7
Signed by: Laurent
SSH key fingerprint: SHA256:kZEpW8cMJ54PDeCvOhzreNr4FSh6R13CMGH/POoO8DI

View file

@ -1,11 +1,9 @@
#!/bin/bash
EMPTY=$(seq 1 10 | jaq -nRc '[inputs | (. | tostring)] | {(.[]): 0}')
# function to get workspaces infos and their window count
spaces (){
ACTIVES=$(hyprctl workspaces -j | jaq -c 'map({key: .id | tostring, value: .windows}) | from_entries')
echo $EMPTY $ACTIVES | jaq -src 'add | to_entries | map({id: (.key | tostring), windows: .value})'
echo $EMPTY $ACTIVES | jaq -src 'add | to_entries | map({id: (.key | tostring), windows: .value}) | sort_by(.id | tonumber)'
}
# print workspaces infos