forked from Shinonome/dots-hyprland
30 lines
648 B
Bash
Executable File
30 lines
648 B
Bash
Executable File
#!/usr/bin/bash
|
|
|
|
geticonlist() {
|
|
classes=$(hyprctl clients | grep -e 'class: ' | sed 's/class: Code/class: code/' | sed 's/\tclass: //')
|
|
addresses=$(hyprctl clients | grep -e ' -> ')
|
|
# echo "$classes"
|
|
IFS=$'\n'
|
|
classarr=($(echo "$classes"))
|
|
|
|
printf '['
|
|
for i in "${!classarr[@]}"; do
|
|
if [ $i -ne 0 ]; then
|
|
printf ', '
|
|
fi
|
|
printf "$i"
|
|
done
|
|
echo ']'
|
|
}
|
|
|
|
geticonlist
|
|
|
|
if [ "$1" == "--once" ]; then
|
|
exit 0
|
|
else
|
|
socat -u UNIX-CONNECT:/tmp/hypr/"$HYPRLAND_INSTANCE_SIGNATURE"/.socket2.sock - | rg --line-buffered "window>>" | while read -r line; do
|
|
geticonlist
|
|
done
|
|
fi
|
|
|