first commit

This commit is contained in:
ShakedGold 2023-06-12 12:27:36 +03:00
commit e2e03d0832
3 changed files with 43 additions and 0 deletions

17
scripts/clients.sh Executable file
View file

@ -0,0 +1,17 @@
#! /bin/bash
missioncontroldir=$HOME/.config/hyprmsn
OLDIFS="$IFS"
IFS=$'\n' # bash specific
chosen=$(for line in $(hyprctl clients | grep "title: " | sed 's/title: //g' | tr -d '\t')
do
special_line=$line
special_line=$(echo $special_line | sed 's/\[\([^]]*\)\]/\\[\1\\]/g') #add \ to []
special_line=$(echo $special_line | sed 's/'\''\.\*\\^//g') #add \ to special characters
icon=$(ls "$missioncontroldir/windows" | grep -F $special_line)
echo -en "$line\x00icon\x1f$missioncontroldir/windows/$icon\n"
done | rofi -dmenu )
IFS="$OLDIFS"
window_id=$(hyprctl clients | rg 'Window ([A-Fa-f0-9]+)' | grep -F "$chosen" | sed -E 's/Window (.*)->.*/\1/g')
hyprctl dispatch focuswindow address:0x$window_id > /dev/null