diff --git a/plugins/README.markdown b/plugins/README.markdown index b815c98..ba89093 100644 --- a/plugins/README.markdown +++ b/plugins/README.markdown @@ -22,6 +22,7 @@ * __node__ – Adds locally installed NodeJS `npm` binary executable modules to the path. * __percol__ – Browse your fish history with [percol](https://github.com/mooz/percol). * __peco__ – Browse your fish history with [peco](https://github.com/peco/peco). +* __osx__ - Integration with Finder and iTunes. * __php__ – Manage phphttp server. * __plenv__ – [plenv](https://github.com/tokuhirom/plenv) Perl binary manager integration. * __pyenv__ – [Simple Python Version Management](https://github.com/yyuu/pyenv) integration. diff --git a/plugins/osx/README.markdown b/plugins/osx/README.markdown new file mode 100644 index 0000000..2fda50d --- /dev/null +++ b/plugins/osx/README.markdown @@ -0,0 +1,17 @@ +osx +--- + +**Maintainer:** [cykeb](https://github.com/CYKEB) + +Inspired by the oh-my-zsh plugin by [sorin-ionescu](https://github.com/sorin-ionescu) +https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/osx/osx.plugin.zsh + +- `tab` - Open the current directory in a new tab +- `pfd` - Return the path of the frontmost Finder window +- `pfs` - Return the current Finder selection +- `cdf` - cd to the current Finder directory +- `pushdf` - pushd to the current Finder directory +- `ql` - Quick Look a specified file +- `manp` - Open a specified man page in Preview +- `trash` - Move a specified file to the Trash +- `itunes` - Play, pause etc. iTunes diff --git a/plugins/osx/cdf.fish b/plugins/osx/cdf.fish new file mode 100644 index 0000000..ec4a8b7 --- /dev/null +++ b/plugins/osx/cdf.fish @@ -0,0 +1,5 @@ +# cd to the current Finder directory + +function cdf -d "cd to the current Finder directory" + cd (pfd) +end \ No newline at end of file diff --git a/plugins/osx/itunes.fish b/plugins/osx/itunes.fish new file mode 100644 index 0000000..139197c --- /dev/null +++ b/plugins/osx/itunes.fish @@ -0,0 +1,33 @@ +# Play, pause etc. iTunes + +function itunes -d "Play, pause etc. iTunes. Use -h or --help for a more detailed description." + if [ (count $argv) -gt 0 ] + set -l opt $argv[1] + switch $opt + case launch play pause stop rewind resume quit + case mute + set opt "set mute to true" + case unmute + set opt "set mute to false" + case next previous + set opt "$opt track" + case vol volume + set opt "set sound volume to $argv[2]" + case "" -h --help + echo "Usage: itunes