diff options
Diffstat (limited to 'config/essentials/shell')
-rw-r--r-- | config/essentials/shell/aliases.sh | 9 | ||||
-rw-r--r-- | config/essentials/shell/functions.sh | 13 |
2 files changed, 7 insertions, 15 deletions
diff --git a/config/essentials/shell/aliases.sh b/config/essentials/shell/aliases.sh index be35a6c..ddc605a 100644 --- a/config/essentials/shell/aliases.sh +++ b/config/essentials/shell/aliases.sh @@ -3,7 +3,8 @@ # The most important one alias vi='vis' -alias cd='z' +which z > /dev/null 2>&1 && + alias cd='z' # Zsh specific aliases if [ $SHELL = "/bin/zsh" ] @@ -53,7 +54,8 @@ alias pf='profanity' alias f='fg' -alias gurk='pgrep gurk > /dev/null && printf "Already Running.\n" || gurk' +which gurk > /dev/null 2>&1 && + alias gurk='pgrep gurk > /dev/null && printf "Already Running.\n" || gurk' alias arduino-cli='arduino-cli --config-file $XDG_CONFIG_HOME/arduino15/arduino-cli.yaml' @@ -162,9 +164,6 @@ alias wtip='wt ip -c -brief addr' alias fusephone='sshfs myphone: /media/phone' alias ttyper='ttyper -l english1000' -alias wgup='doas wg-quick up wg0' -alias wgdown='doas wg-quick down wg0' - # NPM alias npi="npm init --yes" diff --git a/config/essentials/shell/functions.sh b/config/essentials/shell/functions.sh index 976db1e..1b69fbd 100644 --- a/config/essentials/shell/functions.sh +++ b/config/essentials/shell/functions.sh @@ -306,7 +306,7 @@ gdown () { } # toggle wireguard vpn on $1 -> interface -wgtoggle() { +wgt() { d="${1:-wg0}" ip -br a | awk '{print $1}' | grep "$d" > /dev/null && doas wg-quick down "$d" || @@ -318,17 +318,10 @@ serve() { if [ "$1" ] then logn "Serving $1" - docker container run \ - --rm \ - --volume "$(readlink -f "$1")":/data \ - --publish 80:5000 sigoden/dufs /data + dufs "$1" else - logn "Receiving files.." - docker container run \ - --rm \ - --volume /tmp/data:/data \ - --publish 80:5000 sigoden/dufs /data --allow-upload + dufs /tmp/data --alow-upload fi } |