From 84ad770f3df25ee0068d5dd8a7c624361fb9bbe2 Mon Sep 17 00:00:00 2001 From: Keanu Date: Mon, 10 May 2021 12:52:04 +0200 Subject: [PATCH 1/4] [zsh] Added Apache2 plugin. --- zsh/plugins.zsh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zsh/plugins.zsh b/zsh/plugins.zsh index dd62b51..044dc8c 100644 --- a/zsh/plugins.zsh +++ b/zsh/plugins.zsh @@ -105,6 +105,13 @@ _plugin completions 'zsh-users/zsh-completions' "$_checkout_latest_version" # }}} +# Apache2 {{{ + # Crappy solution, but only run if it's on a Raspberry Pi 4 B + if grep -q BCM2711 /proc/cpuinfo; then + _plugin apache2 'voronkovich/apache2.plugin.zsh' + fi +# }}} + # _plugin fzf 'junegunn/fzf' "$_checkout_latest_version" \ # build='./install --bin' \ # after_load='plugin-cfg-path path prepend bin' \ From b7454a658b03418ac0c3543c90959b245a9bac9f Mon Sep 17 00:00:00 2001 From: Keanu Date: Mon, 10 May 2021 12:58:36 +0200 Subject: [PATCH 2/4] [zsh] Added gitio plugin. --- zsh/plugins.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zsh/plugins.zsh b/zsh/plugins.zsh index 044dc8c..f1c9dbe 100644 --- a/zsh/plugins.zsh +++ b/zsh/plugins.zsh @@ -112,6 +112,8 @@ _plugin completions 'zsh-users/zsh-completions' "$_checkout_latest_version" fi # }}} +_plugin gitio 'denysdovhan/gitio-zsh' + # _plugin fzf 'junegunn/fzf' "$_checkout_latest_version" \ # build='./install --bin' \ # after_load='plugin-cfg-path path prepend bin' \ From 47d365b837fb59bd7fdb820385f0916adce763b5 Mon Sep 17 00:00:00 2001 From: Keanu Date: Mon, 10 May 2021 16:05:55 +0200 Subject: [PATCH 3/4] [zsh] Add gpg-crypt commands. --- zsh/functions.zsh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/zsh/functions.zsh b/zsh/functions.zsh index a9d956d..b3cf23a 100644 --- a/zsh/functions.zsh +++ b/zsh/functions.zsh @@ -102,3 +102,25 @@ sudoedit() { } alias sudoe="sudoedit" alias sue="sudoedit" + +# gpg-crypt {{{ + # Encrypt the given file or directory to a given recipient + function gpg-encrypt() { + if [ "$#" -ne 2 ]; then + echo "Usage: $0 FILE/DIRECTORY RECIPIENT" >&2 + return 1 + fi + + tar -c `basename $1` | gpg --encrypt --recipient $2 -o `basename $1`.tar.gpg + } + + # Decrypt the given tar.gpg file + function gpg-decrypt() { + if [ "$#" -ne 1 ] || [[ "$1" != *.tar.gpg ]]; then + echo "Usage: $0 FILE.tar.gpg" >&2 + return 1 + fi + + gpg --quiet --decrypt $1 | tar -x + } +# }}} From 6ebac00f433bc5ee3907405b2f3bb840b1b08eb1 Mon Sep 17 00:00:00 2001 From: Keanu Date: Mon, 10 May 2021 17:20:40 +0200 Subject: [PATCH 4/4] [zsh] Added silence function. --- zsh/functions.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zsh/functions.zsh b/zsh/functions.zsh index b3cf23a..bbf832c 100644 --- a/zsh/functions.zsh +++ b/zsh/functions.zsh @@ -6,6 +6,8 @@ bytecount() { wc -c "$@" | numfmt --to=iec-i; } mkcd() { mkdir -p "$@" && cd "${@[-1]}"; } +silence() { $1 &>/dev/null } + viscd() { setopt local_options err_return local temp_file chosen_dir