diff --git a/bin/2png b/scripts/2png similarity index 100% rename from bin/2png rename to scripts/2png diff --git a/bin/git-move-root-to b/scripts/git-move-root-to similarity index 100% rename from bin/git-move-root-to rename to scripts/git-move-root-to diff --git a/bin/html2pdf b/scripts/html2pdf similarity index 100% rename from bin/html2pdf rename to scripts/html2pdf diff --git a/bin/lesspipe b/scripts/lesspipe similarity index 100% rename from bin/lesspipe rename to scripts/lesspipe diff --git a/zsh/functions/lsarchive b/scripts/lsarchive similarity index 100% rename from zsh/functions/lsarchive rename to scripts/lsarchive diff --git a/scripts/org-clean b/scripts/org-clean new file mode 100755 index 00000000..8823138f --- /dev/null +++ b/scripts/org-clean @@ -0,0 +1,28 @@ +#!/bin/sh + +## Location where org-mode stores attachments +ORG_DIR="$HOME/Dropbox/org/" +DATA_DIR="$ORG_DIR/.attach"; + +echo "The following files appear orphaned:"; + +files=$(find "$DATA_DIR" -type f|perl -ne 'print "$1\n" if /([^\/]*)\/[^\/]*$/'|uniq|while read id; do grep -qiR --include "*.org" "$id" "$ORG_DIR" || find "$DATA_DIR" -ipath "*$id*" -type f; done) + +echo "$files" + +if [ "" == "$files" ]; then + echo "Nothing to do!" + exit +fi + +echo "Delete? y/[n]" +read delete +case $delete in + y) + echo "$files" | while read fn; do rm "$fn"; done + echo "Done." + ;; + *) + echo "Not deleting anything!" + ;; +esac diff --git a/bin/ss b/scripts/ss similarity index 100% rename from bin/ss rename to scripts/ss diff --git a/bin/ss2mov b/scripts/ss2mov similarity index 100% rename from bin/ss2mov rename to scripts/ss2mov diff --git a/zsh/functions/unarchive b/scripts/unarchive similarity index 100% rename from zsh/functions/unarchive rename to scripts/unarchive diff --git a/bin/update b/scripts/update similarity index 100% rename from bin/update rename to scripts/update diff --git a/bin/wrag b/scripts/wrag similarity index 100% rename from bin/wrag rename to scripts/wrag diff --git a/zsh/functions/_lsarchive b/zsh/functions/_lsarchive deleted file mode 100755 index 00f83e05..00000000 --- a/zsh/functions/_lsarchive +++ /dev/null @@ -1,13 +0,0 @@ -#compdef lsarchive -#autoload - -# -# Completes lsarchive. -# -# Authors: -# Sorin Ionescu -# - -_arguments \ - '(-v --verbose)'{-v,--remove}'[verbose archive listing]' \ - "*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|rar|7z)(-.)'" && return 0 diff --git a/zsh/functions/_unarchive b/zsh/functions/_unarchive deleted file mode 100755 index aceb27b6..00000000 --- a/zsh/functions/_unarchive +++ /dev/null @@ -1,13 +0,0 @@ -#compdef unarchive -#autoload - -# -# Completes unarchive. -# -# Authors: -# Sorin Ionescu -# - -_arguments \ - '(-r --remove)'{-r,--remove}'[remove archive]' \ - "*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|rar|7z|deb)(-.)'" && return 0 diff --git a/zshrc b/zshrc index 7740b6d1..d88c0e0e 100644 --- a/zshrc +++ b/zshrc @@ -40,7 +40,7 @@ export ANDROID_SDK=/usr/local/Cellar/android-sdk/24.2 # export PATH=/usr/local/texlive/2015basic/bin/x86_64-darwin:$PATH path=( - $HOME/.dotfiles/bin + $HOME/.dotfiles/scripts $HOME/.{rb,py}env/bin $GOPATH/bin $ANDROID_HOME/platform-tools