It's simple switcher. I use it with gesture engine and it's what I need. It operates with applications on the application layer, omitting some excluded. To fine finish, it needs some instructions for "home button" in "rc.lua" file. Thanks for your tips.
switcher:
Code:
#!/bin/sh
list=`/mnt/us/bin/wmctrl -l | grep L:A_N: | grep -v blankBackground | grep -v titleBar | grep -v lab126.booklet.home | awk '{print $4" "$1}'`
hm=`echo $list | awk 'BEGIN {i=0} {while ($i!="") i++} END {print (i-1)/2}'`
if [ $hm -gt 1 ]; then
WHICHAPP=`cat /tmp/WHICHAPP`
if [ "$WHICHAPP" == "" ]; then WHICHAPP=1 ; fi
if [ "$1" == "next" ]; then
if [ $WHICHAPP -lt $hm ]; then WHICHAPP=$((WHICHAPP+1))
else WHICHAPP=1
fi
fi
if [ "$1" == "prev" ]; then
if [ $WHICHAPP -gt 1 ]; then WHICHAPP=$((WHICHAPP-1))
else WHICHAPP=$hm
fi
fi
idapp=`echo $list | awk -v i=$WHICHAPP 'BEGIN {i=i*2} {print $i}'`
layerA=`echo $list | awk -v i=$WHICHAPP 'BEGIN {i=i*2-1} {print $i}'`
layerD=`echo $layerA | awk 'BEGIN {i=3; printf "L:D_N" ; } FS=":" {while ($i!="") { printf ":"$i ;i++ ;}}'`
/mnt/us/bin/xdotool set_window --name $layerD $idapp
/mnt/us/bin/xdotool set_window --name $layerA $idapp
fi
#export $WHICHAPP
echo $WHICHAPP > /tmp/WHICHAPP
gesture:
Code:
case "$run" in
...
# - pinch + left
3)
$ext/gestures/bin/switcher next &;;
# - pinch + right
4)
$ext/gestures/bin/switcher prev &;;
...