34 lines
1.4 KiB
Bash
34 lines
1.4 KiB
Bash
#!/bin/bash
|
|
#wmclass=$(i3-msg -t get_tree | jq -r '.' | grep class | grep -v i3bar | sed -e 's/ *//g;s/"class"://g;s/^"//g;s/",$//g' | awk '{print NR, $0}')
|
|
|
|
#wmtittle=$(i3-msg -t get_tree | jq -r '.' | grep title | grep -v i3bar | sed -e 's/ *//g;s/"title"://g;s/^"//g;s/",$//g' | awk '{print NR, $0}' | dmenu -l 4)
|
|
|
|
#wmNR=$(echo ${wmtittle} | awk '{print $1}')
|
|
#wmclass=$(i3-msg -t get_tree | jq -r '.' | grep class | grep -v i3bar | sed -e 's/ *//g;s/"class"://g;s/^"//g;s/",$//g' | awk '{print NR, $0}' | grep -E "^${wmNR} "| sed -e "s/^${wmNR} //g")
|
|
#wmtittle=$(echo "${wmtittle}" | sed -e "s/^${wmNR} //g")
|
|
|
|
tmpid=""
|
|
tmpclass=""
|
|
tmptitle=""
|
|
choice=$(while IFS= read -r line
|
|
do
|
|
if ! [ -z "$(echo ${line} | grep -E 'id...[0-9]+')" ]
|
|
then
|
|
tmpid=$(echo ${line} | grep -Eo "[0-9]+")
|
|
fi
|
|
|
|
if ! [ -z "$(echo ${line} | grep -v i3bar | grep -E \"class\")" ]
|
|
then
|
|
tmpclass=$(echo ${line} | grep -E "class" | sed -e 's/ *//g;s/"class"://g;s/^"//g;s/",$//g')
|
|
fi
|
|
|
|
if ! [ -z "$(echo ${line} | grep -v i3bar | grep -E \"title\")" ]
|
|
then
|
|
tmptitle=$(echo ${line} | grep -E "title" | sed -e 's/ *//g;s/"title"://g;s/^"//g;s/",$//g')
|
|
echo "$tmptitle $tmpclass $tmpid"
|
|
fi
|
|
|
|
done<<<$(i3-msg -t get_tree | jq -r '.' | grep -B1 "type.*con" -A41 | grep -E "id...[0-9]+|class|title") | dmenu -l 4)
|
|
|
|
i3-msg "[con_id="$(echo $choice | awk '{print $3}')"]" focus
|