1% 2% anyremote configuration file for amarok management. (Server-mode) 3% v.3 - Improved cover art + library access 4% Made by Carlos Sanchez (chukysoria@gmail.com) 5% 6 7% STATUS stable 8% XTE no 9% SOUND app 10% ENV no 11 12GuiAppName=Amarok v.3/KDE3 13GuiAppBinary=amarok 14GuiAppVersion=echo 'V=`amarok -v|grep KDE|tr -d " "|cut -f 2 -d ":"|cut -f 1 -d "."`; if [ "x$V" == "x3" ]; then echo OK; else echo NOK; fi'|bash -f -s 15GuiAppRun=echo 'A=`dcop 2> /dev/null|grep amarok`; if [ "x$A" == "x" ]; then echo NOK; else echo OK; fi' | bash -f -s 16GuiAppIcon=amarok.png 17GuiAppType=Application 18GuiAppProtocols=Server 19GuiAppDesc=Amarok is the music player for Linux and Unix with an intuitive interface. Amarok makes playing the music you love easier than ever before - and looks good doing it. This configuration supports cover art. This configuration file is for Amarok/KDE3 20 21[Protocol]=Server 22 23(Init)=Include($(CfgDir)/Utils/aliases-server.cfg);\ 24 Exec(echo 'V=`amarok -v|grep KDE|tr -d " "|cut -f 2 -d ":"|cut -f 1 -d "."`;if [ "x$V" == "x4" ]; then $(CfgDir)/Utils/message.sh "ERROR: this configuration file is for KDE3"; fi'|bash -f -s);\ 25 Exec(echo 'P=`which convert 2> /dev/null|grep convert|grep -v no|wc -l|tr -d " "`;if [ "x$P" == "x1" ]; then true; else $(CfgDir)/Utils/message.sh "ERROR: ImageMagic is not installed"; fi'|bash -f -s);\ 26 Make(var,arDir,echo $HOME/.anyRemote/);\ 27 Make(var,cvDir,by_value,$(arDir)amarok_covers/); 28 29(Connect)=Set(parameter,debug,on);\ 30 Make(mode,amarok-v3); 31 32AM_HELP=Set(text,replace,Help,Manage player by joystick or from menu); 33 34AMAROK_V2_SETINFO=ExecAndSet(title,echo 'T=`dcop amarok player title`;A=`dcop amarok player artist`;echo $T by $A'|bash -f -s);\ 35 ExecAndSet(status,dcop amarok player totalTime);\ 36 ExecAndSet(cover, noname,echo 'I=`dcop amarok player coverImage`;F=`basename $I`;convert \( $I -resize $(cover_size)x$(cover_size) \) \( +clone -flip -crop x39.86% -composite \) -append $(cvDir)$F;echo $(cvDir)$F;'|bash -f -s); 37AMAROK_V2_START_TIMER=Macro(AMAROK_V2_SETINFO);\ 38 Timer(AMAROK_V2_SETINFO,5,0); 39AMAROK_V2_STOP_TIMER =Timer(AMAROK_V2_SETINFO,cancel); 40 41 42[Mode]=amarok-v3 43 44AM_V2_LAYOUT=Set(icons,Amarok,1,prev,2,rewind,3,play,4,pause,5,stop,6,forward,7,next,8,none,9,none,*,none,0,none,#,none);Set(font,small);Set(layout,bottomline,joystick_only,choose,3,volume,ticker,up,Vol+,down,Vol-); 45AM_V2_RUN_IF=Exec(echo 'A=`dcop 2> /dev/null|grep amarok`; if [ "x$A" == "x" ]; then amarok& fi' | bash -f -s); 46AM_V2_MENU=Set(menu,replace,Playlist,Mute,Collection Browser,Run Player,Quit Player,Toggle Fullscreen,Help);Macro(ALLIN1MENU);Macro(VOL_SET); 47 48(EnterMode)=Macro(AM_V2_LAYOUT);\ 49 Macro(AM_V2_RUN_IF);\ 50 Exec(rm -rf $(cvDir);mkdir $(cvDir));\ 51 Make(var,cover_size,echo 64);\ 52 Get(cover_size);\ 53 Macro(AMAROK_V2_SETINFO);\ 54 Macro(AM_V2_MENU);\ 55 Macro(AMAROK_V2_START_TIMER); 56 57Cancel=Exec(rm -rf $(cvDir)); 58(Disconnect)=Macro(AMAROK_V2_STOP_TIMER); 59 60Back=Set(text,close);Macro(AM_V2_MENU); 61 62Playlist=Macro(AMAROK_V2_STOP_TIMER);Make(mode,amarok_playlist_v2) 63Collection Browser=Macro(AMAROK_V2_STOP_TIMER);Make(mode,amarok_collection_browser_v2) 64 65Vol+=Exec(dcop amarok player volumeUp);Macro(VOL_SET); 66Vol-=Exec(dcop amarok player volumeDown);Macro(VOL_SET); 67 68Mute=Exec(dcop amarok player mute);Set(volume,0);Set(menu,replace,Playlist,Vol+,Vol-,Unmute,File Browser,Collection Browser,Run Player,Quit Player,Toggle Fullscreen,Help);Macro(ALLIN1MENU); 69Unmute=Exec(dcop amarok player mute);Macro(AM_V2_MENU); 70Toggle Fullscreen=Set(fullscreen,toggle);Set(cover,clear);Get(cover_size); 71 72CoverSize($$)=\ 73 Make(var,cover_size,by_value,$(Index));\ 74 Exec(echo $(arDir) > $HOME/.anyRemote/cover_size); 75 76Run Player=Macro(AM_V2_RUN_IF); 77Quit Player=Exec(dcop amarok MainApplication-Interface quit);Macro(AMAROK_V2_STOP_TIMER);Set(title,);Set(status,); 78Help=Macro(AM_HELP); 79 80VOL_SET=ExecAndSet(volume,dcop amarok player getVolume); 81 82% No more 7 buttons - Nokias Series40 has 160x120 screens 831=Exec(dcop amarok player prev);Macro(AMAROK_V2_SETINFO); 842=Exec(dcop amarok player seekRelative -10) 853=Exec(dcop amarok player play);Macro(AMAROK_V2_START_TIMER);Macro(VOL_SET); 86 874=Exec(dcop amarok player pause);Macro(AMAROK_V2_STOP_TIMER);Set(title,Paused); 885=Exec(dcop amarok player stop);Set(title,Stopped);Macro(AMAROK_V2_STOP_TIMER); 896=Exec(dcop amarok player seekRelative 10) 90 917=Exec(dcop amarok player next);Macro(AMAROK_V2_SETINFO); 92 93[ModeEnd] 94 95[Mode]=amarok_playlist_v2 96(EnterMode)=Set(list,font,small);Set(list,bg,54,73,135);Set(list,fg,141,159,218);ExecAndSet(list,replace,Playlist,dcop amarok playlist saveCurrentPlaylist;grep '<item' $HOME/.kde/share/apps/amarok/current.xml|sed 's/<item url=\"file:\/\/\(.*\)\" \(.\)*$/\1/'|xargs -i basename {}|sed 's/uniqueid=.*//g;s/%20/ /g;s/,/ /g;s/$/,/');Set(menu,add,Play); 97(ExitMode)=Set(list,close);Macro(AMAROK_V2_START_TIMER); 98 99Back($$)=Make(mode,amarok-v3); 100Play($$)=Exec(dcop amarok playlist playByIndex `expr $(Index) - 1`); 101[ModeEnd] 102 103[ModeEnd] 104 105[Mode]=amarok_collection_browser_v2 106 107(EnterMode)=Set(list,font,small);Set(list,bg,54,73,135);Set(list,fg,141,159,218);Macro(FILLLIST_ARTIST);Macro(UPDATEMENU_ARTIST); 108(ExitMode)=Set(list,close); 109 110UPDATEMENU_ARTIST=Set(menu,replace,View Albums,Play Artist,Add Artist,Find); 111FILLLIST_ARTIST=ExecAndSet(list,replace,Artists,dcop amarok collection query "SELECT name FROM artist"|sed "s/\*//"|sed "s/$/,/"); 112 113View Albums($$)=Make(var,current_artist,by_value,$(Param));Make(var,current_artist_index,by_value,$(Index));Set(list,replace,Albums by $(Param),..);Macro(UPDATEMENU_ALBUM);Macro(FILLLIST_ALBUM) 114 115Play Artist($$)=Exec(dcop amarok playlist clearPlaylist; dcop amarok collection query "SELECT DISTINCT t.url FROM tags t where t.artist in (select id from artist where name = '$(Param)')"|sed "s/.\//dcop amarok playlist addMedia \"file:\/\/\//"|sed "s/$/\"/"> $(arDir)file_route;sh $(arDir)file_route; dcop amarok playlist playByIndex 0); 116 117Add Artist($$)=Exec(dcop amarok collection query "SELECT DISTINCT t.url FROM tags t where t.artist in (select id from artist where name = '$(Param)')"|sed "s/.\//dcop amarok playlist addMedia \"file:\/\/\//"|sed "s/$/\"/"> $(arDir)file_route;sh $(arDir)file_route); 118 119Find($$)=Make(mode,amarok_find_song); 120 121UPDATEMENU_ALBUM=Set(menu,replace,View Songs,Play Album,Add Album); 122FILLLIST_ALBUM=ExecAndSet(list,add,SAME,dcop amarok collection query "select distinct a.name from album a, tags b where a.id = b.album and b.artist in (select id from artist where name = '$(current_artist)')"|sed "s/\*//"|sed "s/$/,/") 123 124View Songs(..)=Macro(FILLLIST_ARTIST);Macro(UPDATEMENU_ARTIST);Set(list,select,$(current_artist_index)); 125View Songs($$)=Make(var,current_album,by_value,$(Param));Make(var,current_album_index,by_value,$(Index));Set(list,replace,Songs of $(Param),..);Macro(UPDATEMENU_SONGS);Macro(FILLLIST_SONGS) 126 127Play Album($$)=Exec(dcop amarok playlist clearPlaylist; dcop amarok collection query "SELECT DISTINCT t.url FROM tags t where t.album in (select id from album where name = '$(Param)')"|sed "s/.\//dcop amarok playlist addMedia \"file:\/\/\//"|sed "s/$/\"/"|sed "s/#/&23/"> $(arDir)file_route;sh $(arDir)file_route; dcop amarok playlist playByIndex 0); 128 129Add Album($$)=Exec(dcop amarok collection query "SELECT DISTINCT t.url FROM tags t where t.album in (select id from album where name = '$(Param)')"|sed "s/.\//dcop amarok playlist addMedia \"file:\/\/\//"|sed "s/$/\"/"|sed "s/#/&23/"> $(arDir)file_route;sh $(arDir)file_route); 130 131UPDATEMENU_SONGS=Set(menu,replace,Add to playlist,Add all,Queue,Play,Only by Artist); 132FILLLIST_SONGS=ExecAndSet(list,add,SAME,dcop amarok collection query "SELECT DISTINCT t.title FROM tags t where t.album in (select id from album where name = '$(current_album)')"|sed "s/\*//"|sed "s/$/,/") 133 134Add to playlist(..)=Set(list,replace,Albums by $(current_artist),..);Macro(FILLLIST_ALBUM);Macro(UPDATEMENU_ALBUM);Set(list,select,$(current_album_index)); 135Add to playlist($$)=Exec(dcop amarok collection query "SELECT DISTINCT t.url FROM tags t where t.album in (select id from album where name = '$(current_album)') and t.title = '$(Param)'"|sed "s/.\//dcop amarok playlist addMedia \"file:\/\/\//"|sed "s/$/\"/"|sed "s/#/&23/"> $(arDir)file_route;sh $(arDir)file_route); 136 137Add all($$)=Exec(dcop amarok collection query "SELECT DISTINCT t.url FROM tags t where t.album in (select id from album where name = '$(current_album)')"|sed "s/.\//dcop amarok playlist addMedia \"file:\/\/\//"|sed "s/$/\"/"|sed "s/#/&23/"> $(arDir)file_route;sh $(arDir)file_route); 138 139Queue($$)=Exec(dcop amarok collection query "SELECT DISTINCT t.url FROM tags t where t.album in (select id from album where name = '$(current_album)') and t.title = '$(Param)'"|sed "s/.\//dcop amarok playlist queueMedia \"file:\/\/\//"|sed "s/$/\"/"|sed "s/#/&23/"> $(arDir)file_route;sh $(arDir)file_route); 140 141Play($$)=Exec(dcop amarok collection query "SELECT DISTINCT t.url FROM tags t where t.album in (select id from album where name = '$(current_album)') and t.title = '$(Param)'"|sed "s/.\//dcop amarok playlist playMedia \"file:\/\/\//"|sed "s/$/\"/"|sed "s/#/&23/"> $(arDir)file_route;sh $(arDir)file_route); 142 143Only by Artist($$)=Set(list,replace,SAME,..);Macro(UPDATEMENU_SONGS_ARTIST);Macro(FILLLIST_SONGS_ARTIST) 144 145UPDATEMENU_SONGS_ARTIST=Set(menu,replace,Add to playlist,Add all,Queue,Play,All Album Songs); 146FILLLIST_SONGS_ARTIST=ExecAndSet(list,add,SAME,dcop amarok collection query "SELECT DISTINCT t.title FROM tags t where t.album in (select id from album where name = '$(current_album)') and t.artist in (select id from artist where name = '$(current_artist)')"|sed "s/\*//"|sed "s/$/,/") 147 148All Album Songs($$)=Set(list,replace,SAME,..);Macro(UPDATEMENU_SONGS);Macro(FILLLIST_SONGS) 149Back($$)=Make(mode,amarok-v3); 150 151[ModeEnd] 152 153 154[Mode]=amarok_find_song 155 156(EnterMode)=Set(editfield,Find,Enter song name,); 157(ExitMode)=Set(list,close); 158 159Ok($$)=Make(var,search,by_value,$(Param));Set(list,add,Songs found,..);Macro(UPDATEMENU_SONGS2);Macro(FILLLIST_SONGS2) 160Back($$)=Make(mode,amarok_collection_browser_v2); 161 162 163UPDATEMENU_SONGS2=Set(menu,replace,Add to playlist,Add all,Queue,Play,Find); 164FILLLIST_SONGS2=ExecAndSet(list,replace,SAME,dcop amarok collection query "SELECT DISTINCT t.title FROM tags t where t.title like '%$(search)%' order by t.title"|sed "s/\*//"|sed "s/$/,/") 165 166 167Add to playlist($$)=Exec(dcop amarok collection query "SELECT DISTINCT t.url FROM tags t where t.title = '$(Param)'"|sed "s/.\//dcop amarok playlist addMedia \"file:\/\/\//"|sed "s/$/\"/"|sed "s/#/&23/"> $HOME/.anyRemote/file_route;sh $HOME/.anyRemote/file_route); 168 169Add all($$)=Exec(dcop amarok collection query "SELECT DISTINCT t.url FROM tags t where t.title like '%$(search)%'"|sed "s/.\//dcop amarok playlist addMedia \"file:\/\/\//"|sed "s/$/\"/"|sed "s/#/&23/"> $HOME/.anyRemote/file_route;sh $HOME/.anyRemote/file_route); 170 171Queue($$)=Exec(dcop amarok collection query "SELECT DISTINCT t.url FROM tags t where t.title = '$(Param)'"|sed "s/.\//dcop amarok playlist queueMedia \"file:\/\/\//"|sed "s/$/\"/"|sed "s/#/&23/"> $HOME/.anyRemote/file_route;sh $HOME/.anyRemote/file_route); 172 173Play($$)=Exec(dcop amarok collection query "SELECT DISTINCT t.url FROM tags t where t.title = '$(Param)'"|sed "s/.\//dcop amarok playlist playMedia \"file:\/\/\//"|sed "s/$/\"/"|sed "s/#/&23/"> $HOME/.anyRemote/file_route;sh $HOME/.anyRemote/file_route); 174 175Find($$)=Set(editfield,Enter song name,Find Song,); 176 177[ModeEnd] 178[End] 179