1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
|
%
% anyremote configuration file for basic window manager operations (Server-mode)
% prerequisites: ImageMagic
%
% STATUS stable
% TODO handle FIRE joystick button on Nokia's
% XTEST yes
% SOUND no
% ENV no
% Uncomment if needed
%AutoRepeat=false
%Baudrate=19200
%Device=bluetooth:19
%Log=true
Screen=true
GuiAppName=Window manager
GuiAppBinary=true
GuiAppType=Custom
GuiAppIcon=kde.png
[Aliases]
% Cancel buttons on different phones
-11=Cancel
-8=Cancel
69=Cancel
[End]
[Keys]
(Init)=Macro(CHECK_IMAGIC);Macro(DISPLAYSIZE);Macro(DUMMYSCALE);
CHECK_IMAGIC=Exec(echo 'P=`which convert|grep convert|grep -v not|wc -l`;KD=`which kdialog|grep kdialog|grep -v not|wc -l`;if [ "x$KD" == "x1" ]; then M="kdialog --msgbox"; else M="xmessage"; fi; if [ "x$P" == "x1" ]; then true; else $M "ERROR: ImageMagic is not installed"; fi'|bash -f -s);
DISPLAYSIZE=Make(var,dpy_tmp,xdpyinfo|grep dimensions|tr -s ' '|cut -f 3 -d ' ');\
Make(var,wm_dx,echo $(dpy_tmp)|cut -f 1 -d 'x');\
Make(var,wm_dy,echo $(dpy_tmp)|cut -f 2 -d 'x');
DUMMYSCALE=Make(var,wm_scale,echo "120 160 15");Make(var,wm_rotate,by_value,);
Cancel=Exit
(Connect)=Set(parameter,debug,on);Set(status,Press 1 to see screenshot);\
Set(icons,WinManager,1,view_tree,2,fullscreen,3,minimize,4,default,5,default,6,default,7,default,8,default,9,default,*,question,0,exit,#,default);\
Get(screen_size);
* *=Set(text,replace,Help, Window manager.\n 1 - to show screenshot\nthen use joystick to move a cursor);
Back=Set(list,close);Set(text,close);Set(image,close);Set(menu,replace,)
0=Exit
1=Macro(SHOW);
2=Set(fullscreen,on);Get(screen_size);
3=Set(fullscreen,off);Get(screen_size);
% sure that SizeY will be second one
SizeX($$)=Make(var,wm_cx,by_value,$(Index));
SizeY($$)=Make(var,wm_cy,by_value,$(Index));Macro(SETSCALE)
% sure that PressedY will be second one
PressedX($$)=Make(var,pr_x,echo "$(Index) `echo $(wm_scale)|cut -f 3 -d ' '`"|awk '{n=split($0,a);print int(a[1]*a[2]) }');
PressedY($$)=Make(var,pr_y,echo "$(Index) `echo $(wm_scale)|cut -f 3 -d ' '`"|awk '{n=split($0,a);print int(a[1]*a[2]) }');\
Make(var,pos_x,echo 'X=$(pr_x);if [ "x$(wm_rotate)" == "x-rotate 90" ]; then X=$(pr_y);fi;echo $X;'|bash -f -s);\
Make(var,pos_y,echo 'Y=$(pr_y);if [ "x$(wm_rotate)" == "x-rotate 90" ]; then Y=`expr $(wm_dy) - $(pr_x)`;fi;echo $Y;'|bash -f -s);\
Emulate(mousemove,$(pos_x),$(pos_y),sleep,200000,mouse,1);\
Macro(SHOW2);
PosX($$)=Make(var,pp_x,echo "$(Index) `echo $(wm_scale)|cut -f 3 -d ' '`"|awk '{n=split($0,a);print int(a[1]*a[2]) }');
PosY($$)=Make(var,pp_y,echo "$(Index) `echo $(wm_scale)|cut -f 3 -d ' '`"|awk '{n=split($0,a);print int(a[1]*a[2]) }');\
Make(var,pos_x,echo 'X=$(pp_x);if [ "x$(wm_rotate)" == "x-rotate 90" ]; then X=$(pp_y);fi;echo $X;'|bash -f -s);\
Make(var,pos_y,echo 'Y=$(pp_y);if [ "x$(wm_rotate)" == "x-rotate 90" ]; then Y=`expr $(wm_dy) - $(pp_x)`; fi;echo $Y;'|bash -f -s);\
Emulate(mousemove,$(pos_x),$(pos_y));
WINMENU=Set(menu,replace,Zoom,Close Window,Update,Rotate,Center Cursor,Cursor to UL,Dynamic);
SETSCALE=Make(var,wm_scale,echo "$(wm_cx) $(wm_cy) $(wm_dx) $(wm_dy)"|awk '{n=split($0,a);r1=a[3]/a[1];r2=a[4]/a[2];if(r2>r1) r1=r2; z=sprintf("%f %f %f",a[3]/r1,a[4]/r1, r1);print z;}');
SHOW=ExecAndSet(image,window,cd $HOME/.anyRemote;xwd -silent -root|xwdtopnm|convert - -resize `echo $(wm_scale)|cut -f 1 -d ' '|cut -f 1 -d ','`x`echo $(wm_scale)|cut -f 2 -d ' '|cut -f 1 -d ','` $(wm_rotate) -depth 8 scr.png;echo $HOME/.anyRemote/scr.png);\
Macro(WINMENU);
SHOW2=ExecAndSet(image,window,sleep 1;xwd -silent -root|xwdtopnm|convert - -resize `echo $(wm_scale)|cut -f 1 -d ' '|cut -f 1 -d ','`x`echo $(wm_scale)|cut -f 2 -d ' '|cut -f 1 -d ','` $(wm_rotate) -depth 8 $HOME/.anyRemote/scr.png;echo $HOME/.anyRemote/scr.png);\
Macro(WINMENU);
Close Window=Emulate(keydown,Alt_L,key,F4,keyup,Alt_L);Macro(SHOW2);
Update=Macro(SHOW);
Rotate=Make(var,wm_rotate,echo 'if [ "x$(wm_rotate)" == "x" ]; then echo "-rotate 90"; else echo ""; fi;'|bash -f -s);\
Make(var,tmp,by_value,$(wm_cx));Make(var,wx_cx,by_value,$(wm_cy));Make(var,wm_cy,by_value,$(tmp));\
Macro(SETSCALE);\
Macro(SHOW2);
Cursor to UL=Emulate(mousemove,0,0);Make(var,cur_tmp,echo "$(wm_dy) $(wm_scale)"|awk '{n=split($0,a);print int(a[1]/a[4]);}');\
ExecAndSet(image,set_cursor,echo 'XM=$(cur_tmp);OUT='0,0';if [ "x$(wm_rotate)" == "x-rotate 90" ]; then OUT="$XM,0"; fi;echo $OUT;'|bash -f -s);
Center Cursor=Make(var,ccx,echo $(wm_dx)|awk '{print $0/2;}');Make(var,ccy,echo $(wm_dy)|awk '{print $0/2;}');\
Emulate(mousemove,$(ccx),$(ccy));\
ExecAndSet(image,set_cursor,echo "$(ccx) $(ccy) `echo $(wm_scale)|cut -f 3 -d ' '`"|awk '{n=split($0,a);z=sprintf("%d,%d",a[1]/a[3],a[2]/a[3]);print z;}');
Dynamic=Set(image,dynamic_cursor);Set(menu,replace,Zoom,Close Window,Update,Rotate,Center Cursor,Cursor to UL,NonDynamic);
NonDynamic=Set(image,cursor);Set(menu,replace,Zoom,Close Window,Update,Rotate,Center Cursor,Cursor to UL,Dynamic);
Zoom=SetMode(Zoom);
[Mode]=Zoom
(EnterMode)=Macro(WINSIZE);Macro(SETSCALE);Macro(SHOWWIN);Set(menu,replace,Update,Close);Set(image,nocursor);
(ExitMode)=Macro(DISPLAYSIZE);Macro(SETSCALE);Macro(SHOW2);Macro(WINMENU);Set(image,cursor);
WINSIZE=Exec(cd $HOME/.anyRemote;xwininfo > xwi.tmp);Emulate(sleep,100000,mouse,1);\
Make(var,wm_dx,sleep 1;cat $HOME/.anyRemote/xwi.tmp|grep "\-geometry"|tr -s ' '|cut -d ' ' -f 3|cut -d 'x' -f 1);\
Make(var,wm_dy,cat $HOME/.anyRemote/xwi.tmp|grep "\-geometry"|tr -s ' '|cut -d ' ' -f 3|cut -d 'x' -f 2|cut -d '-' -f 1);
SHOWWIN=ExecAndSet(image,window,sleep 1;cd $HOME/.anyRemote;xwd -id `grep "Window id" xwi.tmp|cut -d ' ' -f 4` -silent|xwdtopnm|convert - $(wm_rotate) -resize `echo $(wm_scale)|cut -f 1 -d ' '|cut -f 1 -d ','`x`echo $(wm_scale)|cut -f 2 -d ' '|cut -f 1 -d ','` -depth 8 scr.png;echo $HOME/.anyRemote/scr.png);
Update=Macro(SHOWWIN);
Close=SetMode(default);
Back=SetMode(default);
[ModeEnd]
[End]
|