From 8fee0aaf97ad5a442055ee75cc7d0dc6111ab6af Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Mon, 13 Jun 2022 11:34:58 +0200 Subject: [PATCH] Added sshgit function --- config/zshrc | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/config/zshrc b/config/zshrc index afad9ba..0023e8e 100644 --- a/config/zshrc +++ b/config/zshrc @@ -99,25 +99,20 @@ alias helios='ssh tdpeuter@helios.ugent.be' alias resblue='systemctl restart bluetooth' alias Personal='cd ~/Documents/synchronisatie/Personal/_PERSOONLIJK/' alias UGent='cd ~/Documents/synchronisatie/UGent/Informatica\ J1\ 2021-2022/' +alias vol='~/.scripts/vol.sh' -vol () { +sshgit () { - if [[ $# == 0 ]] ; then - echo "Volume: $(pamixer --get-volume-human)" - elif [[ "$1" =~ ^[0-9]*$ ]] ; then - pamixer --set-volume "${1}" - vol - elif [[ "$1" =~ ^[+] ]] ; then - pamixer -i "${1#\+}" - vol - elif [[ "$1" =~ ^- ]] ; then - pamixer -d "${1#-}" - vol - elif [[ "$1" =~ m ]] ; then - pamixer --toggle - vol + # Check arguments + if [[ $# -lt 2 ]] ; then + echo "Requires at least two arguments" + exit 1 fi + ssh_key="$1" + shift + GIT_SSH_COMMAND="ssh -i ${ssh_key}" git $@ + } cpdir () {