SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2014-08-09 10:34:44

twoion
Emerald Caffeine
From: 星界
Registered: 2012-05-11
Posts: 1,648

Bash completion for the mpv video player

mpv is nowadays one of the faster moving video/media players on Linux. It's high quality, it merges from both upstream mplayer and has merged much from the (dead) mplayer2 project, besides contributing interesting things on its own.

Well, what it is missing is a Bash completion solution; it's only shipping a Zsh completion. Last night, I hacked together a not-perfect-but-working Bash completion script generator which takes the output of mpv's

mpv --list-options

and creates a completion function that provides TAB-style --argument, --argument option and file path completion for Bash.

Breakage will occur if the --list-options output changes, but who cares. This project's goal is to always have working completion with current versions of mpv.

Debian Package

You can download a Debian package or a stand-alone completion script. The former method installs the completion script into /etc/bash_completion.d, the latter method provides the same script for you to put anywhere you like. Don't forget to re-source your .bashrc

source ~/.bashrc

after installing the package for the completion to become availble in your active shell session.

The files are available for download here Please choose the latest files with the highest version numbers.

Arch Linux Package

mpv-bash-completion-git is available in the AUR. The PKGBUILD is being developed here.

Doing It All By Yourself

Get the source or clone the repository from Github. The included README describes in detail how to build the completion script against your own mpv version.

@Alad has contributed a screencast illustrating the process.

Call for Testers

I'd be happy to receive feedback, bug reports and feature requests from users, either here on the forums or the repo's issue tracker.
--
Thanks for reading.

Last edited by twoion (2015-03-12 15:39:41)


Tannhäuser ~ {www,pkg,ddl}.bunsenlabs.org/{gitlog,repoidx}

Offline

Be excellent to each other!

#2 2014-08-09 13:05:42

Alad
Software Satan
Registered: 2014-02-20
Posts: 1,512

Re: Bash completion for the mpv video player

Let's think for a moment about how badly Github sucks. Many thanks to Bitbucket for allowing me to host these files!

Well, it works if you do it from CLI:

git clone <reponame>
cd <reponame>
mv /path/to/*.deb .
git add .
git commit -a
git push

Works for me.

Many thanks for the completions - will report back after breaking it.  big_smile

Offline

#3 2014-08-09 13:08:34

twoion
Emerald Caffeine
From: 星界
Registered: 2012-05-11
Posts: 1,648

Re: Bash completion for the mpv video player

Alad wrote:

Let's think for a moment about how badly Github sucks. Many thanks to Bitbucket for allowing me to host these files!

Well, it works if you do it from CLI:

git clone <reponame>
cd <reponame>
mv /path/to/*.deb .
git add .
git commit -a
git push

Works for me.

Many thanks for the completions - will report back after breaking it.  big_smile

Naaah, pushing binary files into the tree is not so neat big_smile I don't want to do that anymore.

What I want to do is attaching the files to the release/tag using the Release menu above the source code browser. It won't take DEBs, I tried.

Also, please use the >0.3 release because in the previous ones I forgot to quote the completed strings and upon encountering a Bash magic character...things would break big_smile

Last edited by twoion (2014-08-09 13:09:47)


Tannhäuser ~ {www,pkg,ddl}.bunsenlabs.org/{gitlog,repoidx}

Offline

#4 2014-08-09 13:13:59

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Bash completion for the mpv video player

I'm such a noob!!!

The install of mpv-bash-completion_0.3-1_all.deb went without errors:

    $ ser mpv
p   libdevel-dumpvar-perl                           - Perl module to dump Perl variables                        
i   mpv-bash-completion                             - Bash completion for the mpv video player                  
 
 09 Aug 14 | 09:52:47 ~
    $ mpv-bash-completion
bash: mpv-bash-completion: command not found
 
 09 Aug 14 | 09:53:15 ~
    $ sudo mpv-bash-completion
[sudo] password for sector11: 
sudo: mpv-bash-completion: command not found
 
 09 Aug 14 | 09:53:31 ~
    $ cd /etc/bash_completion.d
 
 09 Aug 14 | 09:54:17 /etc/bash_completion.d
    $ mpv-bash-completion
bash: mpv-bash-completion: command not found
 
 09 Aug 14 | 09:54:19 /etc/bash_completion.d
    $ sudo mpv-bash-completion
sudo: mpv-bash-completion: command not found
 
 09 Aug 14 | 10:09:20 /etc/bash_completion.d
    $ 

2014_08_09_09_59_49_904x837_Sector11.jpg

 09 Aug 14 | 10:12:24 /etc/bash_completion.d
    $ sudo mpv
sudo: mpv: command not found
 
 09 Aug 14 | 10:12:36 /etc/bash_completion.d
    $ 

Heading back to the know nothing corner now....


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#5 2014-08-09 13:21:07

twoion
Emerald Caffeine
From: 星界
Registered: 2012-05-11
Posts: 1,648

Re: Bash completion for the mpv video player

Please stay with me for a little longer ^^ !

It's a completion file for the mpv command. The package puts a script into /etc/bash_completion.d. After re-sourcing Bash completion:

source /etc/bash_completion

you'll have the usual TAB complection for the mpv command (if installed). You can verify that something happened by typing

type _mpv

which should dump the code of the function that the script injected into your environment. The completion will be triggered only if you attempt to complete the 'mpv' command. You can simulate with

alias mpv=echo
mpv --*tab* *tab*

though.

Last edited by twoion (2014-08-09 13:22:22)


Tannhäuser ~ {www,pkg,ddl}.bunsenlabs.org/{gitlog,repoidx}

Offline

#6 2014-08-09 13:27:12

twoion
Emerald Caffeine
From: 星界
Registered: 2012-05-11
Posts: 1,648

Re: Bash completion for the mpv video player

Crap, 0.3 was broken. Should now work again in release 0.4 (option completion, that is).


Tannhäuser ~ {www,pkg,ddl}.bunsenlabs.org/{gitlog,repoidx}

Offline

#7 2014-08-09 13:30:19

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Bash completion for the mpv video player

{snip - showing ending}
eo-align-x --video-align-y --video-aspect --video-pan-x --video-pan-y --video-rotate --video-unscaled --video-zoom --vo --vo-defaults --volstep --volume --volume-restore-data --wid --window-dragging --write-filename-in-watch-later- --x11-name --x11-netwm --{ --}" -- "$cur"))
        ;;
    esac
}
 
 09 Aug 14 | 10:27:28 ~
    $ alias mpv=echo
 
 09 Aug 14 | 10:28:21 ~
    $ mpv --*tab* *tab*
--*tab* Debian-Stable_allpkgs.txt
 
 09 Aug 14 | 10:28:47 ~
    $ 

·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#8 2014-08-09 13:33:41

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Bash completion for the mpv video player

twoion wrote:

Crap, 0.3 was broken. Should now work again in release 0.4 (option completion, that is).

Oh .. OK .. I'm out the door .. will try when I get back.
Should I delete the /etc/bash_completion.d first?


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#9 2014-08-09 13:35:53

twoion
Emerald Caffeine
From: 星界
Registered: 2012-05-11
Posts: 1,648

Re: Bash completion for the mpv video player

Sector11 wrote:
{snip - showing ending}
eo-align-x --video-align-y --video-aspect --video-pan-x --video-pan-y --video-rotate --video-unscaled --video-zoom --vo --vo-defaults --volstep --volume --volume-restore-data --wid --window-dragging --write-filename-in-watch-later- --x11-name --x11-netwm --{ --}" -- "$cur"))
        ;;
    esac
}
 
 09 Aug 14 | 10:27:28 ~
    $ alias mpv=echo
 
 09 Aug 14 | 10:28:21 ~
    $ mpv --*tab* *tab*
--*tab* Debian-Stable_allpkgs.txt
 
 09 Aug 14 | 10:28:47 ~
    $ 

I'm sorry S11, v0.3 was broken...please try again with 0.4 *duck*

camelia:/tmp/b 
 $ mpv file --vf *tab*
crop          dlopen        expand        gradfun       lavfi         noise         pullup        screenshot    sub           vavpp         
delogo        dsize         flip          hqdn3d        mirror        phase         rotate        softpulldown  swapuv        vdpaupp       
divtc         eq            format        ilpack        noformat      pp            scale         stereo3d      unsharp       yadif         
camelia:/tmp/b 

or so should happen. Note that there will be no completion if a) the directory is empty and b) no dash has been typed to indicate an option. It's still a little bit whacky...

Last edited by twoion (2014-08-09 13:36:57)


Tannhäuser ~ {www,pkg,ddl}.bunsenlabs.org/{gitlog,repoidx}

Offline

#10 2014-08-09 13:49:24

twoion
Emerald Caffeine
From: 星界
Registered: 2012-05-11
Posts: 1,648

Re: Bash completion for the mpv video player

Version 0.5 fixes another annoying bug when completing files after a preceding option.


Tannhäuser ~ {www,pkg,ddl}.bunsenlabs.org/{gitlog,repoidx}

Offline

#11 2014-08-09 15:40:53

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Bash completion for the mpv video player

twoion wrote:

Version 0.5 fixes another annoying bug when completing files after a preceding option.

I'mmmmmmmmmmmm baaaaaaaaack!!!!!

twoion wrote:

I'm sorry S11, v0.3 was broken...please try again with 0.4 *duck*

No *ducking* required ... you see:

twoion wrote:

Call for Testers

I'd be happy to receive feedback, bug reports and feature requests from users, either here on the forums or the repo's issue tracker.

... I love ßeta testing things ... and if I can do it you get to add that it is Certified Noob Proof cool

twoion wrote:

Version 0.5 fixes another annoying bug when completing files after a preceding option.

OK we shall see... be right back. ... and I get to skip v4.  big_smile


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#12 2014-08-09 15:47:36

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Bash completion for the mpv video player

OK, you tell me

WARNING

- this is the whole thing so it's a long one:

 09 Aug 14 | 12:42:36 /etc/bash_completion.d
    $ source /etc/bash_completion
 
 09 Aug 14 | 12:42:47 /etc/bash_completion.d
    $ type _mpv
_mpv is a function
_mpv () 
{ 
    local cur=${COMP_WORDS[COMP_CWORD]};
    local prev=${COMP_WORDS[COMP_CWORD-1]};
    if [[ ! $cur =~ ^- ]]; then
        __COMPREPLY=($(compgen -o default -- "$cur"));
        COMPREPLY=();
        for p in "${__COMPREPLY[@]}";
        do
            if [[ -d "$p" ]]; then
                p=${p%/};
                COMPREPLY=("${COMPREPLY[@]}" "$(_mpv_escape "$p/")");
            else
                COMPREPLY=("${COMPREPLY[@]}" "$(_mpv_escape "$p")");
            fi;
        done;
        return 0;
    fi;
    case "$prev" in 
        --ad-lavc-downmix)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --ad-spdif-dtshd)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --af)
            COMPREPLY=($(compgen -W "dummy delay channels format volume equalizer pan surround sub export drc extrastereo lavcac3enc lavrresample sweep hrtf center sinesuppress karaoke scaletempo lavfi convert24 convertsignendian" -- "$cur"))
        ;;
        --af-defaults)
            COMPREPLY=($(compgen -W "dummy delay channels format volume equalizer pan surround sub export drc extrastereo lavcac3enc lavrresample sweep hrtf center sinesuppress karaoke scaletempo lavfi convert24 convertsignendian" -- "$cur"))
        ;;
        --aid)
            COMPREPLY=($(compgen -W "no auto" -- "$cur"))
        ;;
        --ao)
            COMPREPLY=($(compgen -W "pulse alsa oss null pcm" -- "$cur"))
        ;;
        --ao-defaults)
            COMPREPLY=($(compgen -W "pulse alsa oss null pcm" -- "$cur"))
        ;;
        --ass-hinting)
            COMPREPLY=($(compgen -W "none light normal native" -- "$cur"))
        ;;
        --ass-shaper)
            COMPREPLY=($(compgen -W "simple complex" -- "$cur"))
        ;;
        --ass-style-override)
            COMPREPLY=($(compgen -W "no yes force" -- "$cur"))
        ;;
        --ass-use-margins)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --ass-vsfilter-aspect-compat)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --ass-vsfilter-blur-compat)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --ass-vsfilter-color-compat)
            COMPREPLY=($(compgen -W "no basic full force-601" -- "$cur"))
        ;;
        --audio-display)
            COMPREPLY=($(compgen -W "no attachment" -- "$cur"))
        ;;
        --autosync)
            COMPREPLY=($(compgen -W "no" -- "$cur"))
        ;;
        --border)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --cache)
            COMPREPLY=($(compgen -W "no auto" -- "$cur"))
        ;;
        --cache-default)
            COMPREPLY=($(compgen -W "no" -- "$cur"))
        ;;
        --cache-pause-below)
            COMPREPLY=($(compgen -W "no" -- "$cur"))
        ;;
        --colormatrix)
            COMPREPLY=($(compgen -W "auto BT.601 BT.709 SMPTE-240M BT.2020-NCL BT.2020-CL YCgCo" -- "$cur"))
        ;;
        --colormatrix-input-range)
            COMPREPLY=($(compgen -W "auto limited full" -- "$cur"))
        ;;
        --colormatrix-output-range)
            COMPREPLY=($(compgen -W "auto limited full" -- "$cur"))
        ;;
        --colormatrix-primaries)
            COMPREPLY=($(compgen -W "auto BT.601-525 BT.601-625 BT.709 BT.2020" -- "$cur"))
        ;;
        --config)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --cookies)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --correct-pts)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --cursor-autohide)
            COMPREPLY=($(compgen -W "no always" -- "$cur"))
        ;;
        --cursor-autohide-fs-only)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --deinterlace)
            COMPREPLY=($(compgen -W "auto no yes" -- "$cur"))
        ;;
        --demuxer-lavf-allow-mimetype)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --demuxer-lavf-genpts-mode)
            COMPREPLY=($(compgen -W "lavf no" -- "$cur"))
        ;;
        --demuxer-mkv-subtitle-preroll)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --dtshd)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --edition)
            COMPREPLY=($(compgen -W "auto" -- "$cur"))
        ;;
        --embeddedfonts)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --field-dominance)
            COMPREPLY=($(compgen -W "auto top bottom" -- "$cur"))
        ;;
        --fixed-vo)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --force-rgba-osd-rendering)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --force-window)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --force-window-position)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --framedrop)
            COMPREPLY=($(compgen -W "no yes hard" -- "$cur"))
        ;;
        --frames)
            COMPREPLY=($(compgen -W "all" -- "$cur"))
        ;;
        --fs)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --fs-screen)
            COMPREPLY=($(compgen -W "all current" -- "$cur"))
        ;;
        --fullscreen)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --gapless-audio)
            COMPREPLY=($(compgen -W "no yes weak" -- "$cur"))
        ;;
        --hr-seek)
            COMPREPLY=($(compgen -W "no absolute always yes" -- "$cur"))
        ;;
        --hr-seek-framedrop)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --hwdec)
            COMPREPLY=($(compgen -W "no auto vdpau vda vaapi vaapi-copy" -- "$cur"))
        ;;
        --idle)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --index)
            COMPREPLY=($(compgen -W "default recreate" -- "$cur"))
        ;;
        --initial-audio-sync)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --input-cursor)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --input-default-bindings)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --input-joystick)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --input-lirc)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --input-right-alt-gr)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --input-terminal)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --input-test)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --keep-open)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --keepaspect)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --leak-report)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --list-options)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --load-scripts)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --load-unsafe-playlists)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --loop)
            COMPREPLY=($(compgen -W "no 1 inf" -- "$cur"))
        ;;
        --loop-file)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --merge-files)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --mkv-subtitle-preroll)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --msg-color)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --msg-module)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --msg-time)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --mute)
            COMPREPLY=($(compgen -W "auto no yes" -- "$cur"))
        ;;
        --native-keyrepeat)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --no-audio)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --no-sub)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --no-video)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --no-video-aspect)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --oafirst)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --oautofps)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --ocopyts)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --oharddup)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --ometadata)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --oneverdrop)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --ontop)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --orawts)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --ordered-chapters)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --osc)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --osd-bar)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --osd-fractions)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --osd-level)
            COMPREPLY=($(compgen -W "0 1 2 3" -- "$cur"))
        ;;
        --osd-scale-by-window)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --ovfirst)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --pause)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --pts-association-mode)
            COMPREPLY=($(compgen -W "auto decoder sort" -- "$cur"))
        ;;
        --quiet)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --quvi-fetch-subtitles)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --really-quiet)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --resume-playback)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --rtsp-transport)
            COMPREPLY=($(compgen -W "lavf udp tcp http" -- "$cur"))
        ;;
        --save-position-on-quit)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --screen)
            COMPREPLY=($(compgen -W "default" -- "$cur"))
        ;;
        --screenshot-jpeg-baseline)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --screenshot-jpeg-progressive)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --secondary-sid)
            COMPREPLY=($(compgen -W "no auto" -- "$cur"))
        ;;
        --shuffle)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --sid)
            COMPREPLY=($(compgen -W "no auto" -- "$cur"))
        ;;
        --slave-broken)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --softsleep)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --softvol)
            COMPREPLY=($(compgen -W "no yes auto" -- "$cur"))
        ;;
        --stop-screensaver)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --stretch-dvd-subs)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --sub-ass)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --sub-auto)
            COMPREPLY=($(compgen -W "no exact fuzzy all" -- "$cur"))
        ;;
        --sub-fix-timing)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --sub-forced-only)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --sub-gray)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --sub-scale-with-window)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --sub-visibility)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --sws-scaler)
            COMPREPLY=($(compgen -W "fast-bilinear bilinear bicubic x point area bicublin gauss sinc lanczos spline" -- "$cur"))
        ;;
        --term-osd)
            COMPREPLY=($(compgen -W "force auto no" -- "$cur"))
        ;;
        --term-osd-bar)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --terminal)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --tls-verify)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --tv-alsa)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --tv-audio)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --tv-forceaudio)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --tv-immediatemode)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --tv-mjpeg)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --tv-scan-autostart)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --untimed)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --use-filedir-conf)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --v)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --vd-lavc-bitexact)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --vd-lavc-check-hw-profile)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --vd-lavc-fast)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --vd-lavc-show-all)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --vd-lavc-skipframe)
            COMPREPLY=($(compgen -W "none default nonref bidir nonkey all" -- "$cur"))
        ;;
        --vd-lavc-skipidct)
            COMPREPLY=($(compgen -W "none default nonref bidir nonkey all" -- "$cur"))
        ;;
        --vd-lavc-skiploopfilter)
            COMPREPLY=($(compgen -W "none default nonref bidir nonkey all" -- "$cur"))
        ;;
        --vf)
            COMPREPLY=($(compgen -W "crop expand scale format noformat flip rotate mirror pp lavfi screenshot noise eq gradfun unsharp swapuv hqdn3d ilpack dsize softpulldown pullup delogo phase divtc sub yadif stereo3d dlopen vavpp vdpaupp" -- "$cur"))
        ;;
        --vf-defaults)
            COMPREPLY=($(compgen -W "crop expand scale format noformat flip rotate mirror pp lavfi screenshot noise eq gradfun unsharp swapuv hqdn3d ilpack dsize softpulldown pullup delogo phase divtc sub yadif stereo3d dlopen vavpp vdpaupp" -- "$cur"))
        ;;
        --vid)
            COMPREPLY=($(compgen -W "no auto" -- "$cur"))
        ;;
        --video-rotate)
            COMPREPLY=($(compgen -W "no" -- "$cur"))
        ;;
        --video-unscaled)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --vo)
            COMPREPLY=($(compgen -W "vdpau opengl xv opengl-old vaapi x11 null image caca opengl-hq wayland" -- "$cur"))
        ;;
        --vo-defaults)
            COMPREPLY=($(compgen -W "vdpau opengl xv opengl-old vaapi x11 null image caca opengl-hq wayland" -- "$cur"))
        ;;
        --window-dragging)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --write-filename-in-watch-later-)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --x11-netwm)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --{)
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        --})
            COMPREPLY=($(compgen -W "yes no" -- "$cur"))
        ;;
        *)
            COMPREPLY=($(compgen -W " --ad --ad-lavc-ac3drc --ad-lavc-downmix --ad-lavc-o --ad-lavc-threads --ad-spdif-dtshd --af --af-defaults --aid --alang --ao --ao-defaults --ass-force-style --ass-hinting --ass-line-spacing --ass-shaper --ass-style-override --ass-styles --ass-use-margins --ass-vsfilter-aspect-compat --ass-vsfilter-blur-compat --ass-vsfilter-color-compat --audio-channels --audio-delay --audio-demuxer --audio-display --audio-file --audio-format --audio-samplerate --autofit --autofit-larger --autosync --border --brightness --cache --cache-default --cache-file --cache-file-size --cache-initial --cache-pause-below --cache-pause-restart --cache-seek-min --chapter --chapter-merge-threshold --chapter-seek-threshold --colormatrix --colormatrix-input-range --colormatrix-output-range --colormatrix-primaries --config --config-dir --contrast --cookies --cookies-file --correct-pts --cursor-autohide --cursor-autohide-fs-only --deinterlace --demuxer --demuxer-lavf-allow-mimetype --demuxer-lavf-analyzeduration --demuxer-lavf-buffersize --demuxer-lavf-cryptokey --demuxer-lavf-format --demuxer-lavf-genpts-mode --demuxer-lavf-o --demuxer-lavf-probescore --demuxer-lavf-probesize --demuxer-mkv-subtitle-preroll --demuxer-rawaudio-channels --demuxer-rawaudio-format --demuxer-rawaudio-rate --demuxer-rawvideo-codec --demuxer-rawvideo-format --demuxer-rawvideo-fps --demuxer-rawvideo-h --demuxer-rawvideo-mp-format --demuxer-rawvideo-size --demuxer-rawvideo-w --dtshd --dump-stats --dvbin-card --dvbin-prog --dvbin-timeout --dvd-angle --dvd-device --dvd-speed --edition --embeddedfonts --end --field-dominance --fixed-vo --force-rgba-osd-rendering --force-window --force-window-position --fps --framedrop --frames --fs --fs-screen --fullscreen --gamma --gapless-audio --geometry --h --heartbeat-cmd --heartbeat-interval --help --hr-seek --hr-seek-demuxer-offset --hr-seek-framedrop --http-header-fields --hue --hwdec --hwdec-codecs --idle --include --index --initial-audio-sync --input-ar-delay --input-ar-rate --input-cmdlist --input-conf --input-cursor --input-default-bindings --input-doubleclick-time --input-file --input-joystick --input-js-dev --input-key-fifo-size --input-keylist --input-lirc --input-right-alt-gr --input-terminal --input-test --keep-open --keepaspect --leak-report --length --list-options --list-properties --load-scripts --load-unsafe-playlists --loop --loop-file --lua --lua-opts --mc --merge-files --mf-fps --mf-type --mkv-subtitle-preroll --monitoraspect --monitorpixelaspect --msg-color --msg-level --msg-module --msg-time --mute --native-keyrepeat --no-audio --no-sub --no-video --no-video-aspect --o --oac --oacopts --oafirst --oaoffset --oautofps --ocopyts --of --ofopts --ofps --oharddup --omaxfps --ometadata --oneverdrop --ontop --orawts --ordered-chapters --ordered-chapters-files --osc --osd-back-color --osd-bar --osd-bar-align-x --osd-bar-align-y --osd-bar-h --osd-bar-w --osd-blur --osd-border-color --osd-border-size --osd-color --osd-duration --osd-font --osd-font-size --osd-fractions --osd-level --osd-margin-x --osd-margin-y --osd-scale --osd-scale-by-window --osd-shadow-color --osd-shadow-offset --osd-spacing --osd-status-msg --ovc --ovcopts --ovfirst --ovoffset --panscan --pause --playlist --profile --pts-association-mode --pvr-abitrate --pvr-alayer --pvr-amode --pvr-arate --pvr-aspect --pvr-fmt --pvr-vbitrate --pvr-vmode --pvr-vpeak --quiet --quvi-fetch-subtitles --quvi-format --really-quiet --referrer --reset-on-next-file --resume-playback --rtsp-transport --saturation --save-position-on-quit --screen --screenshot-format --screenshot-jpeg-baseline --screenshot-jpeg-dpi --screenshot-jpeg-optimize --screenshot-jpeg-progressive --screenshot-jpeg-quality --screenshot-jpeg-smooth --screenshot-png-compression --screenshot-png-filter --screenshot-template --secondary-sid --show-profile --shuffle --sid --slang --slave-broken --softsleep --softvol --softvol-max --speed --sstep --start --stop-screensaver --stream-capture --stream-dump --stretch-dvd-subs --sub-ass --sub-auto --sub-codepage --sub-delay --sub-demuxer --sub-file --sub-fix-timing --sub-forced-only --sub-fps --sub-gauss --sub-gray --sub-paths --sub-pos --sub-scale --sub-scale-with-window --sub-speed --sub-text-back-color --sub-text-blur --sub-text-border-color --sub-text-border-size --sub-text-color --sub-text-font --sub-text-font-size --sub-text-margin-x --sub-text-margin-y --sub-text-shadow-color --sub-text-shadow-offset --sub-text-spacing --sub-visibility --sws-cgb --sws-chs --sws-cs --sws-cvs --sws-lgb --sws-ls --sws-scaler --term-osd --term-osd-bar --term-osd-bar-chars --term-playing-msg --term-status-msg --terminal --title --tls-ca-file --tls-verify --tv-adevice --tv-alsa --tv-amode --tv-audio --tv-audioid --tv-audiorate --tv-automute --tv-balance --tv-bass --tv-brightness --tv-buffersize --tv-chanlist --tv-channel --tv-channels --tv-contrast --tv-decimation --tv-device --tv-driver --tv-forceaudio --tv-forcechan --tv-fps --tv-freq --tv-gain --tv-height --tv-hue --tv-immediatemode --tv-input --tv-mjpeg --tv-norm --tv-normid --tv-outfmt --tv-quality --tv-saturation --tv-scan-autostart --tv-scan-period --tv-scan-threshold --tv-treble --tv-volume --tv-width --untimed --use-filedir-conf --user-agent --v --V --vd --vd-lavc-bitexact --vd-lavc-check-hw-profile --vd-lavc-fast --vd-lavc-o --vd-lavc-show-all --vd-lavc-skipframe --vd-lavc-skipidct --vd-lavc-skiploopfilter --vd-lavc-threads --version --vf --vf-defaults --vid --video-align-x --video-align-y --video-aspect --video-pan-x --video-pan-y --video-rotate --video-unscaled --video-zoom --vo --vo-defaults --volstep --volume --volume-restore-data --wid --window-dragging --write-filename-in-watch-later- --x11-name --x11-netwm --{ --}" -- "$cur"))
        ;;
    esac
}
 
 09 Aug 14 | 12:43:00 /etc/bash_completion.d
    $ alias mpv=echo
 
 09 Aug 14 | 12:43:48 /etc/bash_completion.d
    $ mpv --*tab* *tab*
--*tab* *tab*
 
 09 Aug 14 | 12:43:57 /etc/bash_completion.d
    $ mpv

 
 09 Aug 14 | 12:44:20 /etc/bash_completion.d
    $ 

·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#13 2014-08-09 15:52:58

twoion
Emerald Caffeine
From: 星界
Registered: 2012-05-11
Posts: 1,648

Re: Bash completion for the mpv video player

Are you sure you have re-loaded the environment or spawned a new shell?

source /etc/bash_completion

Because that's an old version; 0.5 starts with this fragment:

_mpv(){
  local cur=${COMP_WORDS[COMP_CWORD]}
  local prev=${COMP_WORDS[COMP_CWORD-1]}
  if [[ -z $cur ]] || [[ ! $cur =~ ^- && ! $prev =~ ^- ]] ; then
    __COMPREPLY=($(compgen -o default -- "$cur")) 
    COMPREPLY=()
    for p in "${__COMPREPLY[@]}" ; do
      if [[ -d "$p" ]] ; then

I just verified that the package installs correctly and contains the correct script...

Last edited by twoion (2014-08-09 15:53:25)


Tannhäuser ~ {www,pkg,ddl}.bunsenlabs.org/{gitlog,repoidx}

Offline

#14 2014-08-09 16:03:03

twoion
Emerald Caffeine
From: 星界
Registered: 2012-05-11
Posts: 1,648

Re: Bash completion for the mpv video player

Pushed 0.6 fixing another completion regression.

@S11: Feel free to take a break smile


Tannhäuser ~ {www,pkg,ddl}.bunsenlabs.org/{gitlog,repoidx}

Offline

#15 2014-08-09 16:19:01

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Bash completion for the mpv video player

twoion wrote:

Pushed 0.6 fixing another completion regression.

@S11: Feel free to take a break smile

No way, I'm a Taurus (stubborn) OK ... we move ahead ...

    $ ser mpv
p   libdevel-dumpvar-perl                           - Perl module to dump Perl variables                        
i   mpv-bash-completion                             - Bash completion for the mpv video player                  
 
 09 Aug 14 | 13:16:41 /etc/bash_completion.d
    $ remv mpv-bash-completion
[sudo] password for sector11: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  mpv-bash-completion
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 36.9 kB disk space will be freed.
Do you want to continue [Y/n]? 
(Reading database ... 111356 files and directories currently installed.)
Removing mpv-bash-completion ...
 
 09 Aug 14 | 13:17:19 /etc/bash_completion.d
    $ 

2014_08_09_13_20_25_550x400_Sector11.jpg


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#16 2014-08-09 16:29:13

twoion
Emerald Caffeine
From: 星界
Registered: 2012-05-11
Posts: 1,648

Re: Bash completion for the mpv video player

That looks good!

--
PS. Thanks to your reference, I'm now stuck in Wikipedia reading up on my own zodiac :-(

Last edited by twoion (2014-08-09 16:36:05)


Tannhäuser ~ {www,pkg,ddl}.bunsenlabs.org/{gitlog,repoidx}

Offline

#17 2014-08-09 16:34:48

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Bash completion for the mpv video player

OK, I'm doing something wrong and can't see it:

 09 Aug 14 | 13:28:13 ~
    $ ser mpv
p   libdevel-dumpvar-perl                           - Perl module to dump Perl variables                        
i   mpv-bash-completion                             - Bash completion for the mpv video player                  
 
 09 Aug 14 | 13:28:44 ~
    $ sho mpv-bash-completion
Package: mpv-bash-completion      
State: installed
Automatically installed: no
Version: 0.6-1
Priority: extra
Section: checkinstall
Maintainer: root@camelia
Architecture: all
Uncompressed Size: 36.9 k
Depends: bash-completion
Description: Bash completion for the mpv video player
 

 
 09 Aug 14 | 13:29:00 ~
    $ cd /etc/bash_completion.d
 
 09 Aug 14 | 13:29:17 /etc/bash_completion.d
    $ source /etc/bash_completion
 
 09 Aug 14 | 13:29:33 /etc/bash_completion.d
    $ type _mpv
_mpv is a function
_mpv () 
{ 
    local cur=${COMP_WORDS[COMP_CWORD]};
    local prev=${COMP_WORDS[COMP_CWORD-1]};
    if [[ ! $cur =~ ^- ]]; then
        __COMPREPLY=($(compgen -o default -- "$cur"));
        COMPREPLY=();
        for p in "${__COMPREPLY[@]}";
        do
            if [[ -d "$p" ]]; then
                p=${p%/};
                COMPREPLY=("${COMPREPLY[@]}" "$(_mpv_escape "$p/")");
            else
                COMPREPLY=("${COMPREPLY[@]}" "$(_mpv_escape "$p")");
            fi;
{snip}

I'm in #! Waldorf does that make a difference?


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#18 2014-08-09 16:42:17

twoion
Emerald Caffeine
From: 星界
Registered: 2012-05-11
Posts: 1,648

Re: Bash completion for the mpv video player

Interesting, maybe the global Bash configuration or such differs between Unstable and/or Wheezy or due to my local configuration...anyway,

source /etc/bash_completion.d/mpv

should definitely do the job, from whatever shell.


Tannhäuser ~ {www,pkg,ddl}.bunsenlabs.org/{gitlog,repoidx}

Offline

#19 2014-08-09 18:12:07

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Bash completion for the mpv video player

sad  sad  sad  sad  sad  - same stuff  roll

 09 Aug 14 | 15:07:13 ~
    $ source /etc/bash_completion.d/mpv
 
 09 Aug 14 | 15:07:16 ~
    $ type _mpv
_mpv is a function
_mpv () 
{ 
    local cur=${COMP_WORDS[COMP_CWORD]};
    local prev=${COMP_WORDS[COMP_CWORD-1]};
    if [[ -z $cur && ! $prev =~ ^- ]] || [[ ! $cur =~ ^- && ! $prev =~ ^- ]]; then
        __COMPREPLY=($(compgen -o default -- "$cur"));
        COMPREPLY=();
        for p in "${__COMPREPLY[@]}";
        do
            if [[ -d "$p" ]]; then
                p=${p%/};
                COMPREPLY=("${COMPREPLY[@]}" "$(_mpv_escape "$p/")");
            else
                COMPREPLY=("${COMPREPLY[@]}" "$(_mpv_escape "$p")");
            fi;
        done;
        return 0;

and:

 09 Aug 14 | 15:09:03 ~
    $ alias mpv=echo
 
 09 Aug 14 | 15:09:07 ~
    $ mpv --*tab* *tab*
--*tab* Debian-Stable_allpkgs.txt
 
 09 Aug 14 | 15:09:18 ~
    $ mpv

 
 09 Aug 14 | 15:09:28 ~
    $ 

Ummmmm do I need mplayer or mplayer2 installed?
I know - now is a really dumb time to ask.   8o


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#20 2014-08-09 18:39:42

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,572

Re: Bash completion for the mpv video player

^ I would suspect you need mpv installed, but it may not be in the debian stable repos - available for testing and sid; not sure if it's available from debian-multimedia repos.


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#21 2014-08-09 19:03:23

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Bash completion for the mpv video player

sad well that clears that up ... not in Waldorf.   mad  mad


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#22 2014-08-09 19:37:01

Alad
Software Satan
Registered: 2014-02-20
Posts: 1,512

Re: Bash completion for the mpv video player

Offline

#23 2014-08-09 21:54:20

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 13,970

Re: Bash completion for the mpv video player

^^^ & ^^ http://deb-multimedia.org/pool/main/
Nope, not in the deb-multimedia Wheezy repo.  So sad.  (Same Old Stuff, Another Day.)

Offline

#24 2014-08-09 23:50:55

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,572

Re: Bash completion for the mpv video player

I did that twice (salix and debian testing) - it works, but anyone trying this will want to carefully read the howto's - particularly for dependencies.

I don't know if it will pull anything in that will bork a debian stable set up.

Last edited by PackRat (2014-08-09 23:51:40)


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

Help fund CrunchBang, donate to the project!

#25 2014-08-10 02:29:50

twoion
Emerald Caffeine
From: 星界
Registered: 2012-05-11
Posts: 1,648

Re: Bash completion for the mpv video player

Actually, it should be independent of whether mpv is installed or not as it only completes the 'mpv' command ...

$ export PATH=/bin/ # for sed, but remove everything else, including mpv
$ mpv
bash: mpv: command not found
$ mpv --*tab*
Display all 384 possibilities? (y or n)

Must be an issue with local or global completion configuration or Bash versions as Unstable (me) is on 4.3 and Stable/Wheezy is still on 4.2. Could somebody else please take a shot?

Last edited by twoion (2014-08-10 02:30:21)


Tannhäuser ~ {www,pkg,ddl}.bunsenlabs.org/{gitlog,repoidx}

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo