%
% anyremote configuration file for Gpicview (http://lxde.sourceforge.net/gpicview/) management. (Server-mode)
%

% STATUS stable
% XTEST yes
% SOUND no
% ENV no
% FBROWSER v.3i
% DEF_PIX_VIEWER   
% ALL_IN_ONE 

GuiAppName=GPicView
GuiAppBinary=gpicview
GuiAppRun=echo 'ID=`id -u`;A=`ps -fu $ID|grep gpicview|grep -v grep|grep -v anyremote|grep -v edit`; if [ "x$A" = "x" ]; then echo NOK; else echo OK; fi'|sh -s
GuiAppIcon=gpicview.png
GuiAppType=Application
GuiAppProtocols=Server
GuiAppDesc=GPicView - A Simple and Fast Image Viewer for X

[Protocol]=Server

(Init)=\
	Include($(CfgDir)/Utils/aliases-server.cfg);\
	Include($(CfgDir)/Utils/aliases-server-fbrowser-v3i.cfg);\
	Include($(CfgDir)/Utils/aliases-server-pix-viewer.cfg);\
	Make(var,app_name,by_value,GPicView);\
	Make(var,open_file,by_value,);\
	Make(var,app_manage_mode,by_value,gpicview_manage);

(Connect)=Make(mode,gpicview_init);

[Mode]= gpicview_init : default_pixviewer_init

APP_IS_RUN=\
	Make(var,app_run,ps -fu `id -u`|grep gpicview|grep -v grep|grep -v anyremote|grep -v edit|head -1|wc -l);

[ModeEnd]

[Mode]=gpicview_manage : default_pixviewer

% (EnterMode) by Utils/aliases-server-pix-viewer.cfg

% Override
SETUP_DEFAULT_PIXVIEWER=\
	Set(layout,default);\
 	Set(icons,$(app_name),\
		1,folder,2,plus,3,refresh,\
		4,rewind,5,fit,6,forward,\
		7,none,8,minus,9,none,\
		*,question,0,fullscreen,#,no);\
	Set(status,$(app_name));\
	Set(title,);

% Override
* *=Set(text,replace,Help,1 File Browser\n2 Zoom In\n3 Rotate Right\n4 Previous\n5 Fit\n6 Next\n7\n8 Zoom Out\n9\n ** Help\n0 Fullscreen\n# Quit $(app_name)\n);

APP_START_IF=\
	Make(var,app_run,ps -fu `id -u`|grep gpicview|grep -v grep|grep -v anyremote|grep -v edit|head -1|wc -l);\
	Exec(if [ "x$(app_run)" = "x0" ]; then cd "`cat $HOME/.anyRemote/ar_storedir.tmp`";gpicview $(open_file)& fi 2> /dev/null);

APP_RAISE=\
	Exec($(CfgDir)/Utils/run-or-switch-to.sh -switch gpicview);

APP_QUIT=\
	Emulate(key,Q);\
	Exec(pkill gpicview);

APP_MENU=\
	Set(menu,replace,Slideshow,Rotate Left,Rotate Right,Power Off,Suspend);\
	Macro(ALLIN1MENU);

APP_FULLSCREEN=Emulate(key,F11)

% Power Off, Suspend by Utils/aliases-server-pix-viewer.cfg
Slideshow=Emulate(key,W)
Rotate Left=Emulate(key,L)
Rotate Right=Macro(PIX_ROTATE)

PIX_PREV=Emulate(key,Page_Up)
PIX_NEXT=Emulate(key,Page_Down)
PIX_FIRST=Make(none)
PIX_LAST=Make(none)
PIX_ZOOM_IN=Emulate(key,KP_Add)
PIX_ZOOM_OUT=Emulate(key,minus)
PIX_FIT=Emulate(key,f)
PIX_ROTATE=Emulate(key,R)

[ModeEnd]

[End]
