Server IP : 103.119.228.120 / Your IP : 3.147.65.111 Web Server : Apache System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : nobody ( 99) PHP Version : 5.6.40 Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/zsh/5.0.2/functions/ |
Upload File : |
#compdef mpc local OUT foo MPD_MUSIC_DIR MPC_PLAYLIST_MATCHER MPC_FORMAT_STRING # set this style to whatever --format string you want to use when # constructing the list of playlist entries zstyle -s ":completion:${curcontext}:*" mpc-format-string MPC_FORMAT_STRING foo=(--format "${(q)MPC_FORMAT_STRING:-%file%}") # set this style to the music_directory of mpd to get _files based completion # for commands like "add" zstyle -s ":completion:${curcontext}:" mpd-music-directory MPD_MUSIC_DIR # matcher used for playlist completion zstyle -s ":completion:${curcontext}:" mpd-playlist-matcher \ MPC_PLAYLIST_MATCHER : ${MPC_PLAYLIST_MATCHER:='m:{a-z}={A-Z} l:|=**'} # this one is used to configure the behaviour of _mpc_helper_songnumbers, # see _pids for the original zstyle -s ":completion:${curcontext}:song-numbers" insert-song-numbers \ OUT || OUT=single _mpc_command() { local mpc_cmds mpc_cmds=( add:"add a song to the current playlist" clear:"clear the current playlist" crop:"remove all songs except for the currently playing song" current:"show the currently playing song" crossfade:"set and display crossfade settings" del:"remove a song from the current playlist" disable:"disable a output" enable:"enable a output" idle:"wait until an event occurs" idleloop:"loop waiting for events" listall:"list all songs in the music directory" load:"load file as a playlist" ls:"list the contents of specified directory" lsplaylists:"list currently available playlists" move:"move song in playlist" next:"play the next song in the current playlist" outputs:"show the current outputs" pause:"pause the currently playing song" play:"start playing" playlist:"print the current playlist" prev:"play the previous song in the current playlist" random:"toggle random mode, or specify state" repeat:"toggle repeat mode, or specify state" single:"toggle single mode, or specify state" consume:"toggle consume mode, or specify state" rm:"remove a playlist" save:"save a playlist to file" search:"search for a song" find:"search for a song, exact match" list:"list all tags of given type" seek:"seek to the position specified in percent" shuffle:"shuffle the current playlist" stats:"display statistics about MPD" stop:"stop the currently playing playlists" toggle:"toggles Play/Pause, plays if stopped" update:"scan music directory for updates" version:"report version of MPD" volume:"set volume" status:"display MPD status" ) if (( CURRENT == 1 )); then _describe -t command "mpc commands" mpc_cmds else local curcontext="$curcontext" fi local cmd=$words[1] local curcontext="${curcontext%:*}:mpc-${cmd}" _call_function ret _mpc_$cmd } _mpc_helper_bool() { local expl states states=(on off yes no 1 0 true false) _wanted states expl boolean compadd $expl -a states } (( $+functions[_mpc_helper_songnumbers] )) || _mpc_helper_songnumbers() { local out sn list expl MATCH desc all NM ret=1 _tags song-numbers || return 1 if [[ "$PREFIX" = [0-9]# ]]; then all=() MATCH="*${(Q)PREFIX}[0-9]#*" else all=(-U) MATCH="(#i)*${(Q)PREFIX}*" NM="$compstate[nmatches]" fi out=("${(@f)$(_call_program song-numbers mpc $foo playlist 2>/dev/null)}") out=("${(@M)out[@]:#${~MATCH}}") sn=("${(@)${(@M)out}//(#b)(#s)(\#|[ >]#)([0-9]#)*/$match[2]}") list=("${(@Mr:COLUMNS-1:)out}") _wanted -V 'song numbers' expl 'song number' \ compadd "$@" -ld list "$all[@]" -a sn && ret=0 if [[ -n "$all" ]]; then case "$OUT" in menu) compstate[insert]=menu ;; single) [[ $compstate[nmatches] -ne NM+1 ]] && compstate[insert]= ;; *) [[ ${#:-$PREFIX} -gt ${#compstate[unambiguous]} ]] && compstate[insert]=menu ;; esac fi return ret } (( $+functions[_mpc_helper_playlists] )) || _mpc_helper_playlists() { local list expl list=($(mpc lsplaylists)) _wanted list expl playlist compadd -M $MPC_PLAYLIST_MATCHER $expl -a list } (( $+functions[_mpc_helper_files] )) || _mpc_helper_files() { if [[ -n $MPD_MUSIC_DIR ]]; then _files -W $MPD_MUSIC_DIR return fi local -U list expl if [[ $words[CURRENT] != */* ]]; then list=( ${${(f)"$(mpc listall)"}%%/*}) _wanted files expl file compadd -qS/ -a list else list=(${(f)"$(mpc tab $words[CURRENT])"}) _wanted files expl file _multi_parts / list fi } (( $+functions[_mpc_helper_directories] )) || _mpc_helper_directories() { if [[ -n $MPD_MUSIC_DIR ]]; then _files -/ -W $MPD_MUSIC_DIR return fi local -U list expl if [[ $words[CURRENT] != */* ]]; then list=( ${${(M)${(f)"$(mpc listall)"}:#*/*}%%/*}) _wanted directories expl directory compadd -qS/ -a list else list=(${(f)"$(mpc lstab $words[CURRENT])"}) _wanted directories expl directory _multi_parts / list fi } (( $+functions[_mpc_helper_outputs] )) || _mpc_helper_outputs() { local vals outline vals=(${${${${(M)${(f)"$(mpc outputs 2> /dev/null)"}:#Output * \(*\) is (en|dis)abled}##Output }%%\) is (en|dis)abled}/ \(/:}) _describe -t outputs output vals } _mpc_add() { _mpc_helper_files } _mpc_del() { _mpc_helper_songnumbers } _mpc_play() { _mpc_helper_songnumbers } _mpc_seek() { _message "floating point percent value" } _mpc_enable() { _mpc_helper_outputs } _mpc_disable() { _mpc_helper_outputs } _mpc_move() { if (( $#words <= 3 )); then _mpc_helper_songnumbers else _message "nothing" fi } _mpc_listall() { _mpc_helper_files } _mpc_ls() { _mpc_helper_directories } _mpc_load() { _mpc_helper_playlists } _mpc_save() { _mpc_helper_playlists } _mpc_rm() { _mpc_helper_playlists } _mpc_volume() { local expl compset -P '[-+]' _wanted list expl volume compadd $expl - {0..100} } _mpc_repeat() { _mpc_helper_bool } _mpc_random() { _mpc_helper_bool } _mpc_single() { _mpc_helper_bool } _mpc_consume() { _mpc_helper_bool } _mpc_search() { local list expl list=(album artist title track name genre date composer performer comment disc filename any) if [[ $#words -eq 2 ]]; then _wanted list expl table compadd $expl -a list else _message "pattern" fi } _mpc_find() { _mpc_search "$@" } _mpc_list() { _mpc_search "$@" } _mpc_update() { _mpc_helper_files } _arguments \ '--format[specify the format of song display]:format string' \ '--no-status[prevent printing song status on completion]' \ '*::mpc command:_mpc_command'