%
% anyremote configuration file for Comix (http://comix.sourceforge.net) management. (Server-mode)
%

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

GuiAppName=Comix
GuiAppBinary=comix
GuiAppRun=echo 'ID=`id -u`;A=`ps -fu $ID|grep comix|grep python|grep -v grep`; if [ "x$A" = "x" ]; then echo NOK; else echo OK; fi'|sh -s
GuiAppIcon=comix.png
GuiAppType=Application
GuiAppProtocols=Server
GuiAppDesc=Comix is a user-friendly, customizable image viewer. It is specifically designed to handle comic books, but also serves as a generic viewer. It reads images in ZIP, RAR or tar archives (also gzip or bzip2 compressed) as well as plain image files.

[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,Comix);\
	Make(var,open_file,by_value,);\
	Make(var,app_manage_mode,by_value,comix_manage);

(Exit)=\
	Macro(FBROWSER_IC_EXIT);

(Connect)=Make(mode,comix_init);

[Mode]=comix_init: default_pixviewer_init

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

[ModeEnd]

[Mode]=comix_manage : default_pixviewer

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

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

APP_RAISE=\
	Exec(wmctrl -i -a `wmctrl -l -p|grep Comix|cut -d ' ' -f 1` 2> /dev/null);

APP_QUIT=\
	Exec(pkill -f "python.*comix");

APP_FULLSCREEN=Emulate(key,f)

PIX_PREV=Emulate(key,Page_Up)
PIX_NEXT=Emulate(key,Page_Down)
PIX_FIRST=Emulate(key,Home);
PIX_LAST=Emulate(key,End);
PIX_ZOOM_IN=Emulate(key,a,key,KP_Add)
PIX_ZOOM_OUT=Emulate(key,a,key,minus)
PIX_FIT=Emulate(key,a,key,b)
PIX_ROTATE=Emulate(key,r)

[ModeEnd]

[End]
