%
% anyremote configuration file for impressive (former keyjnote) management (Server-mode)
%
% Thanks Cedric Barboiron for this configuration file.
%

% STATUS stable
% XTEST yes
% SOUND no
% ENV no
% FBROWSER v.3i
% DEF_PRESENTATION   
% ALL_IN_ONE
% MEDIACENTER presentation

GuiAppName=Impressive
GuiAppBinary=impressive.py
GuiAppIcon=impressive.png
GuiAppRun=echo 'ID=`id -u`;P=`ps -fu $ID|grep impressive.py|grep -v grep|grep python`; if [ "x$P" = "x" ]; then echo NOK; else echo OK; fi'|sh -s
GuiAppType=Application
GuiAppProtocols=Server
GuiAppDesc=Impressive is a program that displays PDF presentation slides with style.

[Protocol]=Server

(Init)=\
	Include($(CfgDir)/Utils/aliases-server.cfg);\
	Include($(CfgDir)/Utils/aliases-server-fbrowser-v3i.cfg);\
	Macro(FBROWSER_IC_INIT);\
	Include($(CfgDir)/Utils/aliases-server-presentation.cfg);\
	Make(var,app_name,by_value,Impressive);\
	Make(var,open_file,by_value,);\
	Make(var,exec_app_name, which impressive 2> /dev/null);\
	Make(var,exec_app_name,if [ "x$(exec_app_name)" = "x" ]; then echo "xterm -e `which impressive.py`"; else echo $(exec_app_name); fi);\
	Make(var,app_manage_mode,by_value,impressive_manage);

(Exit)=\
	Macro(FBROWSER_IC_EXIT);

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

[Mode]=impressive : default_presentation_init

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

% Can not switch to
APP_MANAGE=\
	Exec(pkill -f 'python (.)*impressive');\
	Set(title, );\
	Macro(APP_CHOOSE_FILE);

[ModeEnd]

[Mode]=impressive_manage : default_presentation

SETUP_DEFAULT_PRESENTATION=\
	Set(layout,default);\
 	Set(icons,$(app_name),\
		1,folder,2,up,3,none,\
		4,rewind,5,fullscreen,6,forward,\
		7,prev,8,down,9,next,\
		*,question,0,none,#,no);\
	Set(status,$(app_name));\
	Set(title,$(open_file));

% Overrides	
2=Emulate(key,Up);
8=Emulate(key,Down);
0=Make(none);
* *=Set(text,replace,Help,1\n2 Up\n3\n4 Previous Page/Left\n5 Fullscreen\n6 Next Page/Right\n7 First Page\n8 Down\n9 Last Page\n ** Help\n0\n# Quit $(app_name)\n);

APP_SETUP=\
	Make(none);

APP_START_IF=\
	Exec(cd "$(fbrowser_dir)";$(exec_app_name) $(open_file));

% Can not switch to
APP_RAISE=\
	Make(none);

APP_QUIT=\
    Emulate(key,Q);\
	Exec(pkill -f 'python (.)*impressive');\
	Set(title, );

APP_MENU=\
	Set(menu,replace,Overview,Fade To Back,Fade To White,Page Toggle,PowerMgmt);\
	Macro(ALLIN1MENU);\
	Macro(MEDIACENTER_MENU);

Fade To Black=\
    Emulate(key,B)

Fade To White=\
    Emulate(key,W)

Page Toggle=\
    Emulate(key,L)

Overview=\
    Emulate(key,Tab)

PRES_PREV_PAGE=\
	Emulate(key,Left);
	
PRES_NEXT_PAGE=\
	Emulate(key,Right);

PRES_ZOOM_IN=\
	Make(none);
	
PRES_ZOOM_OUT=\
	Make(none);

PRES_FIRST_PAGE=\
	Emulate(key,Home);
	
PRES_LAST_PAGE=\
	Emulate(key,End);
	
PRES_TOGGLE_FULLSCREEN=\
	Emulate(key,F);
	
PRES_REFRESH=\
	Make(none);

[ModeEnd]

[End]
