View Single Post
Old 01-28-2014, 05:47 AM   #14
peterhey
Member
peterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the huskpeterhey can grip it by the husk
 
Posts: 21
Karma: 141126
Join Date: Dec 2013
Device: touch
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 &;;

...

Last edited by peterhey; 01-28-2014 at 06:07 AM.
peterhey is offline   Reply With Quote