diff options
-rwxr-xr-x | bin/extra/supd | 22 | ||||
-rwxr-xr-x | bin/menuscripts/mpower | 7 | ||||
-rw-r--r-- | config/essentials/zsh/functions.zsh | 1 |
3 files changed, 20 insertions, 10 deletions
diff --git a/bin/extra/supd b/bin/extra/supd index 931d808..a383d65 100755 --- a/bin/extra/supd +++ b/bin/extra/supd @@ -1,24 +1,30 @@ #!/bin/sh -print_dir () { printf '%s: ' "$1" | sed "s#$HOME#~#" >&2; } +usage() { >&2 printf "usage: supd\nusage: supd <prefix> <dir>"; exit 1; } check () { for dir in $1 do - print_dir "$2/$dir" + printf '%s: ' "$2/$dir" | sed "s#$HOME#~#" >&2 cd "$2/$dir" || continue git pull > /dev/null 2>&1 && printf 'Up to date.' || printf 'Couldn'\''t update.' + printf ' ' + git status --short 2> /dev/null | head -n1 | awk '{print $1 " "}' printf '\n' done } -dirs="installdrier dotfiles password-store" -prefix="$HOME/src" +if [ "$#" -eq 0 ] +then + dirs="installdrier dotfiles password-store" + prefix="$HOME/src" +else + prefix="$1" + shift || usage + dirs="$*" + [ "$dirs" ] || usage +fi check "$dirs" "$prefix" - -# dirs="$(ls -1 "$HOME/proj/personal")" -# prefix="$HOME/proj/personal" -# check "$dirs" "$prefix" diff --git a/bin/menuscripts/mpower b/bin/menuscripts/mpower index 00fb96c..1543a0b 100755 --- a/bin/menuscripts/mpower +++ b/bin/menuscripts/mpower @@ -1,8 +1,11 @@ #!/bin/sh -choice="$(printf 'poweroff +choice="$( +cat <<EOF | commander -c +poweroff suspend hibernate reboot -' | commander -c)" +EOF +)" [ "$choice" ] && systemctl "$choice" diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.zsh index fda80fb..ed5f677 100644 --- a/config/essentials/zsh/functions.zsh +++ b/config/essentials/zsh/functions.zsh @@ -66,6 +66,7 @@ oclip() { printf "\033]52;c;$(echo -n "$@" | base64)\a"; } sms() { ssh -t phone sendmsg "$1" "'$2'"; } trcp() { scp "$1" db:/media/basilisk/downloads/transmission/torrents/; } rln() { ln -s "$(readlink -f "$1")" "$2"; } +getgit() { git clone git@db:"$1"; } ipc() { |