diff --git a/shells/zshrc b/shells/zshrc index 833a59f..b3e1658 100644 --- a/shells/zshrc +++ b/shells/zshrc @@ -51,6 +51,7 @@ asroot(){ xauth extract $TEMPFILE $DISPLAY sudo zsh -c "xauth merge $TEMPFILE;(srm $TEMPFILE||rm $TEMPFILE)&'$@';" } +# De-symlink dsl() { while (( $# > 0 )); do readlink $1 2>&1 >/dev/null && mv $(readlink $1) $1 @@ -58,12 +59,14 @@ dsl() { done } dedir(){ - mv "$1"/* . - rmdir "$1" - if (( !? != 0 )); then - mv "$1"/.* . - fi - rmdir "$1" + chronic rmdir "$1" -v && return + name=$(uuidgen) + # Move it to a random name without clobbering, this prevents things like + # files/files + # From erroring because you can't move files/files to . + chronic mv -n "$1" "$name" || return 5 + chronic mv "$name"/*(D) . + chronic rmdir -v "$name" } alias afci='git x ./autoformat.sh;git add --all;git commit -m "Autoformatted"' alias cpatch='diff -crB' @@ -110,7 +113,7 @@ alias skim="(head -5; tail -5) <" alias cp='rsync --partial -ha --info=progress2 "$@"' mv() { /bin/mv -v "$@" } m() { mv "$@" } -#compdef _cp c cfat m mv cp +compdef _cp c cfat m mv cp alias dt='date "+%F %T"' alias awake='disphost; while true; do xdotool mousemove 0 0; sleep 60; done' alias adk='/home/stonewareslord/Applications/adk/bin/studio.sh & disown' @@ -358,7 +361,6 @@ compdefas () { } compdefas ssh tsh compdefas mv m mv -compdefas rsync c cp cfat mcl(){ mkdir -p $1 cd $1