From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23332 invoked by alias); 21 Nov 2010 15:48:54 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15561 Received: (qmail 8223 invoked from network); 21 Nov 2010 15:48:50 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,T_TO_NO_BRKTS_FREEMAIL autolearn=no version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at physik.hu-berlin.de does not designate permitted sender hosts) Date: Sun, 21 Nov 2010 15:56:24 +0100 From: Eike von Seggern To: zsh-users@zsh.org Subject: Re: Completion nyxmms2 Message-ID: <20101121145624.GA3479@matzbach> Mail-Followup-To: zsh-users@zsh.org References: <101120115618.ZM6420@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="tThc/1wpZn/ma/RB" Content-Disposition: inline In-Reply-To: <101120115618.ZM6420@torch.brasslantern.com> User-Agent: Mutt/1.5.20 (2009-06-14) --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Nov 20, 2010 at 11:56 -0800, Bart Schaefer wrote: > On Nov 20, 6:05pm, Michel wrote: >} Subject: Completion nyxmms2 >} >} Hello everybody ! >} >} I use xmms2 with nyxmms2 to listen my songs but I don't have the >} completion with nyxmms2. >} Exist a file for the completion of nyxmms2 ? > > http://www.mail-archive.com/xmms2-devel@lists.xmms.se/msg02017.html > > That thread mentions sending us the completions to include with zsh, > but I don't think that ever happened. Hi, attached is the _nyxmms2 file that I use. I don't remember where I got it from. Probably from the xmms2 web site. I haven't updated it recently, but it works well with Dr.No for me. tschuess eike --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=_nyxmms2 #compdef nyxmms2 _nyxmms2_command() { local nyxmms2_cmds nyxmms2_cmds=( add:"add the matching media or files to a playlist" addpls:"add a playlist file" scap:"stop, clear playlist, add arguments and start playing" list:"lists the playlist" search:"Search and print all media matching the pattern" remove:"remove the matching media from a playlist" clear:"clears the playlist" play:"starts playback" pause:"pause playback" stop:"stops playback" toggle:"toggles playback status between play/pause" seek:"seek to a specific place in current song" next:"play next song" prev:"play previous song" jump:"take a leap in the playlist" move:"move a entry in the playlist" collection:"collection manipulation - type 'nyxmms2 help collection' for more extensive help" playlist:"playlist manipulation - type 'nyxmms2 help playlist' for more extensive help" server:"server manipulation - type 'nyxmms2 help server' for more extensive help" status:"display playback status, either continuously or once" info:"display all the properties for all media matching the pattern" help:"print help about a command" ) if (( CURRENT == 1 )); then _describe -t command "nyxmms2 commands" nyxmms2_cmds else local curcontext="$curcontext" fi local cmd=$words[1] local curcontext="${curcontext%:*}:nyxmms2-${cmd}" _call_function ret _nyxmms2_$cmd } _nyxmms2_jump() { songlist=(${"$(nyxmms2 list)"}) playlistitems=() for song ($songlist); do if [[ $song = (#b)' '\[(<->)/(<->)\]' '(*)' '\((*)\) ]]; then playlistitems+=("$match[1][$match[3]]") fi done _values -s ' ' 'playlist items' ${(On)playlistitems} } _nyxmms2_playlist() { local playlist_cmds playlist_cmds=( list:"list all playlists" switch:"change the active playlist" create:"create a new playlist" rename:"rename a playlist" remove:"remove the given playlist" clear:"clear a playlist, by default, clear the active playlist" shuffle:"shuffle a playlist, by default, shuffle the active playlist" sort:"sort a playlist, by default, sort the active playlist." config:"configure a playlist, by default, sort the active playlist." ) if (( CURRENT == 2 )); then _describe -t command "nyxmms2 playlist commands" playlist_cmds else local curcontext="$curcontext" fi local cmd=$words[2] local curcontext="${curcontext%:*}:nyxmms2-${cmd}" _call_function ret _nyxmms2_playlist_$cmd } _nyxmms2_playlist_helper() { local list oifs="$IFS" IFS=" list=($(nyxmms2 playlist list|sed 's/^..//')) IFS="$oifs" _describe -t command "nyxmms2 playlists" list } _nyxmms2_playlist_switch() { _nyxmms2_playlist_helper } _nyxmms2_playlist_sort() { _nyxmms2_playlist_helper } _nyxmms2_playlist_shuffle() { _nyxmms2_playlist_helper } _nyxmms2_playlist_clear() { _nyxmms2_playlist_helper } _nyxmms2_playlist_remove() { _nyxmms2_playlist_helper } #FIXME: TODO rename, other sort args, config _nyxmms2_collection() { local collection_cmds collection_cmds=( list:"list all collection" show:"display a human-readable description of a collection" create:"create a new collection" rename:"rename a collection" remove:"remove a collection" config:"get or set attributes for the given collection" ) if (( CURRENT == 2 )); then _describe -t command "nyxmms2 collection commands" collection_cmds else local curcontext="$curcontext" fi local cmd=$words[2] local curcontext="${curcontext%:*}:nyxmms2-${cmd}" _call_function ret _nyxmms2_collection_$cmd } _nyxmms2_collection_helper() { local list oifs="$IFS" IFS=" list=($(nyxmms2 collection list|sed 's/^..//')) IFS="$oifs" _describe -t command "nyxmms2 playlists" list } _nyxmms2_collection_rename() { _nyxmms2_collection_helper } _nyxmms2_collection_config() { _nyxmms2_collection_helper } _nyxmms2_collection_remove() { _nyxmms2_collection_helper } _nyxmms2_collection_show() { _nyxmms2_collection_helper } _nyxmms2_add() { _files } _nyxmms2_scap() { _files } _nyxmms2() { _arguments \ '--format[specify the format of song display]:format string' \ '--no-status[prevent printing song status on completion]' \ '*::nyxmms2 command:_nyxmms2_command' } _nyxmms2 "$@" --tThc/1wpZn/ma/RB--