%
% anyremote configuration file for gthumb management. (Server-mode)
% thanks Adriaan van Kekem for this configuration file
%

% STATUS stable
% XTEST yes
% SOUND no
% ENV no
% FBROWSER v.4i
% DEF_PIX_VIEWER   
% ALL_IN_ONE
% MEDIACENTER photo

GuiAppName=gthumb
GuiAppBinary=gthumb
GuiAppRun=echo 'ID=`id -u`;A=`ps -fu $ID|grep gthumb|grep -v grep|grep -v anyremote|grep -v edit`; if [ "x$A" = "x" ]; then echo NOK; else echo OK; fi'|sh -s
GuiAppIcon=gthumb.png
GuiAppType=Application
GuiAppProtocols=Server
GuiAppDesc=gThumb is an image viewer and browser for the GNOME Desktop.

[Protocol]=Server

(Init)=\
	Include($(CfgDir)/Utils/aliases-server.cfg);\
	Include($(CfgDir)/Utils/aliases-server-fbrowser-v4i.cfg);\
	Macro(FBROWSER_IC_INIT);\
	Include($(CfgDir)/Utils/aliases-server-pix-viewer.cfg);\
	Make(var,app_name,by_value,gThumb);\
	Make(var,open_file,by_value,);\
	Make(var,app_manage_mode,by_value,gthumb_manage);
	
(Exit)=\
	Macro(FBROWSER_IC_EXIT);

(Connect)=\
	Make(mode,gthumb_init);

[Mode]=gthumb_init : default_pixviewer_init

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

[ModeEnd]

[Mode]=gthumb_manage : default_pixviewer

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

APP_MENU=\
	Set(menu,replace,Page Up,Page Down,Rotate Left,Rotate Right,Toggle preview,Slideshow,Stop slideshow,PowerMgmt);\
	Macro(ALLIN1MENU);\
	Macro(MEDIACENTER_MENU);

% PowerMgmt by Utils/aliases-server.cfg

Rotate Left=\
    Emulate(key,bracketleft);

Rotate Right=\
    Macro(PIX_ROTATE);

Toggle preview=\
    Emulate(key,F8);

Slideshow=\
    Emulate(key,F5);

Stop slideshow=\
    Emulate(key,Escape);

Page Up=\
    Emulate(key,Page_Up);

Page Down=\
    Emulate(key,Page_Down);

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

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

APP_QUIT=\
	Exec(pkill gthumb);
	
APP_FULLSCREEN=\
	Emulate(key,F11)

PIX_PREV=\
    Emulate(key,BackSpace);

PIX_NEXT=\
    Emulate(key,Space)

PIX_FIRST=\
    Emulate(key,Home);

PIX_LAST=\
    Emulate(key,End);

PIX_ZOOM_IN=\
    Emulate(key,plus)

PIX_ZOOM_OUT=\
    Emulate(key,minus)

PIX_FIT=\
    Emulate(keydown,Control_L);\
	Emulate(key,e);\
	Emulate(keyup,Control_L);

PIX_ROTATE=\
    Emulate(key,bracketright)

[ModeEnd]

[End]
