From 70aa423d536a9142d6c38cd19e09f86457247683 Mon Sep 17 00:00:00 2001 From: Gal Szkolnik Date: Wed, 29 Jun 2022 01:24:41 -0400 Subject: [PATCH] Better use of which-command and a clip func --- _home/dot_sz.shrc.d/21_aliases | 4 ++++ _home/dot_sz.shrc.d/bash.post/99_terraform.complete | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/_home/dot_sz.shrc.d/21_aliases b/_home/dot_sz.shrc.d/21_aliases index 0333ba6..9b34382 100644 --- a/_home/dot_sz.shrc.d/21_aliases +++ b/_home/dot_sz.shrc.d/21_aliases @@ -10,3 +10,7 @@ alias lessr="less --raw-control-chars " alias sz-edshrc="ed ~/.sz.shrc.d ; exec $SHELL" [[ -z "$(env inkscape 2> /dev/null)" && -n "$(flatpak info org.inkscape.Inkscape 2> /dev/null)" ]] && alias inkscape="flatpak run org.inkscape.Inkscape " + +function clip() { + xclip -i -sel clipboard +} diff --git a/_home/dot_sz.shrc.d/bash.post/99_terraform.complete b/_home/dot_sz.shrc.d/bash.post/99_terraform.complete index 33b8b21..60cb98d 100644 --- a/_home/dot_sz.shrc.d/bash.post/99_terraform.complete +++ b/_home/dot_sz.shrc.d/bash.post/99_terraform.complete @@ -1,4 +1,4 @@ -TERRAFORM_BIN=$(type -fP terraform | head -1) -if [[ -n $TERRAFORM_BIN ]]; then +TERRAFORM_BIN=$(which-command terraform | head -1) +if [[ -x $TERRAFORM_BIN ]]; then complete -C $TERRAFORM_BIN terraform fi