From 5cc46a4f22bb89dd21e9646d1a3d1f3d91a44ba2 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 20 Nov 2015 04:54:30 -0500 Subject: [PATCH] bin/ -> scripts/ --- {bin => scripts}/2png | 0 {bin => scripts}/git-move-root-to | 0 {bin => scripts}/html2pdf | 0 {bin => scripts}/lesspipe | 0 {zsh/functions => scripts}/lsarchive | 0 scripts/org-clean | 28 ++++++++++++++++++++++++++++ {bin => scripts}/ss | 0 {bin => scripts}/ss2mov | 0 {zsh/functions => scripts}/unarchive | 0 {bin => scripts}/update | 0 {bin => scripts}/wrag | 0 zsh/functions/_lsarchive | 13 ------------- zsh/functions/_unarchive | 13 ------------- zshrc | 2 +- 14 files changed, 29 insertions(+), 27 deletions(-) rename {bin => scripts}/2png (100%) rename {bin => scripts}/git-move-root-to (100%) rename {bin => scripts}/html2pdf (100%) rename {bin => scripts}/lesspipe (100%) rename {zsh/functions => scripts}/lsarchive (100%) create mode 100755 scripts/org-clean rename {bin => scripts}/ss (100%) rename {bin => scripts}/ss2mov (100%) rename {zsh/functions => scripts}/unarchive (100%) rename {bin => scripts}/update (100%) rename {bin => scripts}/wrag (100%) delete mode 100755 zsh/functions/_lsarchive delete mode 100755 zsh/functions/_unarchive 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