From e7d7f07f7d652159b405f4172280c180e61ca326 Mon Sep 17 00:00:00 2001 From: Truls Date: Sat, 16 Dec 2017 23:41:56 +0100 Subject: [PATCH] Updated Examples (markdown) --- Examples.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/Examples.md b/Examples.md index 22a1e7c..fb380f6 100644 --- a/Examples.md +++ b/Examples.md @@ -633,6 +633,7 @@ bip() { } ``` + ```sh # Update (one or multiple) selected application(s) # mnemonic [B]rew [U]pdate [P]lugin @@ -659,6 +660,56 @@ bcp() { } ``` + +### Homebrew Cask + + +# Install ore open webpage for selected application +# using brew cask search as input source +# and display a info quickview window for the currently marked application +```sh +install() { + local token + token=$(brew cask search | fzf-tmux --query="$1" +m --preview 'brew cask info {}') + + if [ "x$token" != "x" ] + then + echo "(I)nstall or open the (h)omepage of $token" + read input + if [ $input = "i" ] || [ $input = "I" ]; then + brew cask install $token + fi + if [ $input = "h" ] || [ $input = "H" ]; then + brew cask home $token + fi + fi +} +``` + + +# Uninstall ore open webpage for selected application +# using brew list search as input source (all brew cask installed applications) +# and display a info quickview window for the currently marked application +```sh +uninstall() { + local token + token=$(brew cask list | fzf-tmux --query="$1" +m --preview 'brew cask info {}') + + if [ "x$token" != "x" ] + then + echo "(U)ninstall or open the (h)omepage of $token" + read input + if [ $input = "u" ] || [ $input = "U" ]; then + brew cask uninstall $token + fi + if [ $input = "h" ] || [ $token = "h" ]; then + brew cask home $token + fi + fi +} +``` + + ### v #### Inspired by [v](https://github.com/rupa/v). Opens files in ~/.viminfo