cd94999266d555659eb21c50c3c9b7a531e809a2
[packages.git] / utils / anyremote / files / anyremote.cfg
1 %
2 % anyremote configuration file for sound management. (Server-mode)
3 % prerequisites: amixer utility
4 %
5
6 % STATUS stable
7 % XTEST no
8 % SOUND mixer
9 % ENV no
10
11 % Uncomment if needed
12 %AutoRepeat=false
13 %Baudrate=19200
14 Device=bluetooth:19
15 %Log=true
16 Screen=true
17
18 GuiAppName=Sound volume test
19 GuiAppIcon=sound.png
20 GuiAppType=Example
21 GuiAppBinary=true
22
23 % 1 - increase sound volume
24 % 2 - mute/unmute
25 % 3 - increase sound volume
26 % 5 -  show list of available controls
27
28 [Aliases]
29
30 % Aliases for AverMedia IR remote
31 VOLUMEDOWN=1
32 MIN_INTERESTING=2
33 VOLUMEUP=3
34 TEXT=*
35
36 [End]
37
38 [Keys]
39
40 (Init)   =Macro(SET_CARD);Macro(TEST_MIXER);Macro(INIT_CONTROL);
41 (Connect)=Set(parameter,debug,on);\
42         Set(icons,SoundControl,1,minus,2,mute,3,plus,4,default,5,configure,6,default,7,default,8,default,9,default,0,default,*,question,#,default);\
43         Macro(SET_VIEW);
44
45 SET_CARD    =Make(var,mixer_card,echo 'if [ -f $HOME/.anyRemote/amixer.card ]; then cat $HOME/.anyRemote/amixer.card; else true; fi;'|bash -f -s);
46 TEST_MIXER  =Exec(echo 'TEST=`amixer $(mixer_card) sget Master,0`;U=`echo $TEST|grep "Usage: amixer" |wc -l`;KD=`which kdialog|grep kdialog|grep -v not|wc -l`;if [ "x$KD" == "x1" ]; then M="kdialog --msgbox"; else M="echo";fi;if [ "x$U" != "x0" ]; then $M "ERROR: You have to correct example according to Your system configuration !"; fi;'|bash -f -s);
47 INIT_CONTROL=Exec(echo 'if [ -f $HOME/.anyRemote/amixer.control ]; then true; else echo "Master@0" > $HOME/.anyRemote/amixer.control; fi;'|bash -f -s)
48 SET_VIEW    =Set(menu,add,Controls);ExecAndSet(title,cat $HOME/.anyRemote/amixer.control|sed "s/@/,/");
49
50 Cancel=Exit
51
52 Controls=ExecAndSet(list,replace,Mixer Controls,amixer scontrols|sed 's/Simple mixer control //;s/,/@/;s/$/,/');Set(menu,replace,Choose);
53 Choose($$)=Exec(echo $(Param) > $HOME/.anyRemote/amixer.control);Set(list,close);Macro(SET_VIEW);
54 Back=Set(text,close);Macro(SET_VIEW);
55 Back($$)=Set(list,close);Macro(SET_VIEW);
56
57 1=Exec(amixer $(mixer_card) sset `cat $HOME/.anyRemote/amixer.control|sed "s/@/,/"` 5%-    -q)
58 2=Exec(amixer $(mixer_card) sset `cat $HOME/.anyRemote/amixer.control|sed "s/@/,/"` toggle -q)
59 3=Exec(amixer $(mixer_card) sset `cat $HOME/.anyRemote/amixer.control|sed "s/@/,/"` 5%+    -q)
60
61 5=Macro(Controls);
62
63 * *=Set(text,replace,Help,1 - Vol-\n2 - Mute/Unmute\n3 - Vol+\n5 - Choose mixer control)
64
65 [End]
66