From f74cd971c177cdd1533d4b192ac53fca24359068 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Wed, 3 Jul 2013 23:24:01 +0200 Subject: [PATCH] Misc: file hierarchy reorganization --- .config/newsbeuter/config | 2 -- .rtorrent.rc | 8 ++++---- .scripts/homeclean | 25 +++++++++++++++++-------- .scripts/homeinit | 8 +++++--- 4 files changed, 26 insertions(+), 17 deletions(-) diff --git a/.config/newsbeuter/config b/.config/newsbeuter/config index 84e8e59a..b856b343 100644 --- a/.config/newsbeuter/config +++ b/.config/newsbeuter/config @@ -9,6 +9,4 @@ highlight article "^Author:" blue default bold highlight article "^Links?:" yellow default bold highlight article "^Date:" magenta default bold -cache-file "~/.cache/newsbeuter/cache.db" - ## End \ No newline at end of file diff --git a/.rtorrent.rc b/.rtorrent.rc index 141f895f..36368f46 100644 --- a/.rtorrent.rc +++ b/.rtorrent.rc @@ -23,7 +23,7 @@ directory = ~/temp # Default session directory. Make sure you don't run multiple instance # of rtorrent using the same session directory. Perhaps using a # relative path? -session = ~/.session +session = ~/.cache/rtorrent # Watch a directory for new torrents, and stop those that have been # deleted. @@ -74,11 +74,11 @@ encryption = allow_incoming,require,require_RC4 # May be set to "disable" (completely disable DHT), "off" (do not start DHT), # "auto" (start and stop DHT as needed), or "on" (start DHT immediately). # The default is "off". For DHT to work, a session directory must be defined. -# +# dht = auto -# UDP port to use for DHT. -# +# UDP port to use for DHT. +# # dht_port = 6881 # Enable peer exchange (for torrents not marked private) diff --git a/.scripts/homeclean b/.scripts/homeclean index 92811a28..ff749539 100755 --- a/.scripts/homeclean +++ b/.scripts/homeclean @@ -3,6 +3,7 @@ RMLIST="$HOME/.cache/dwb $HOME/.cache/emacs $HOME/.cache/mutt +$HOME/.cache/rtorrent $HOME/.cmus/autosave $HOME/.cmus/cache $HOME/.cmus/lib.pl @@ -12,18 +13,15 @@ $HOME/.cmus/resume $HOME/.cmus/search-history $HOME/.config/gtk-2.0 $HOME/.config/gtk-3.0 -$HOME/.config/newsbeuter/cache.db -$HOME/.config/newsbeuter/history.cmdline -$HOME/.config/newsbeuter/history.search $HOME/.config/ranger/bookmarks $HOME/.config/ranger/history $HOME/.config/ranger/tagged $HOME/.gtk-bookmarks $HOME/.local/share/newsbeuter $HOME/.local/share/webkit -$HOME/.mutt-pwds.cpt -$HOME/.session/* +$HOME/.mutt.pwds.cpt $HOME/.ssh +$HOME/.w3m $HOME/.zcompdump $HOME/.zdirs $HOME/.zshhistfile" @@ -42,15 +40,26 @@ if [ "$CHOICE" != "Y" ]; then fi ## Delete git repo if any. -[ -d "$HOME"] && rm -rvf "$HOME/.git" +if [ -d "$HOME/.git" ]; then + echo + echo "==> Cleaning git repo." + rm -rf "$HOME/.git" +fi ## Delete Dropbox folder if any. -[ -d "$HOME" ] && rm -rvf "$HOME/Dropbox" && rm -rvf "$HOME/.dropbox" +if [ -d "$HOME/Dropbox" ] || [ -d "$HOME/.dropbox" ]; then + echo + echo "==> Cleaning Dropbox folder." + rm -rvf "$HOME/Dropbox" + rm -rvf "$HOME/.dropbox" +fi ## Clean trash if possible. if [ -z "$(command -v trash-empty)" ]; then echo - echo "==> 'trash-empty' not installed, you have to clean trash manually." + echo "==> Emptying trash." + echo ":: 'trash-empty' not installed, you have to clean trash manually." + rm -rvf "$HOME/.local/share/Trash" else echo echo "==> Emptying trash." diff --git a/.scripts/homeinit b/.scripts/homeinit index 9212e4c7..17929e1c 100755 --- a/.scripts/homeinit +++ b/.scripts/homeinit @@ -10,7 +10,7 @@ SOURCEDIR="$HOME/personal/dataperso" ## Temp folder echo "==> 'temp' folder" -mkdir -p temp +mkdir -p "$HOME/temp" echo ## Emacsclient launcher. Required for best emacsclient integration. For a fully @@ -65,7 +65,7 @@ if [ -n "$(command -v mutt)" ]; then echo fi -if [ -d "$SOURCEDIR" ]; then +if [ -d "$SOURCEDIR/todo" ]; then echo "==> To-Do" ln -snf "$SOURCEDIR/todo/todo.org" "$HOME/todo.org" echo @@ -73,7 +73,9 @@ fi if [ -n "$(command -v rtorrent)" ]; then echo "==> rtorrent" - mkdir -p "$HOME/.session" + mkdir -p "$HOME/.cache/rtorrent" + ## TODO: the mkdir with the awk command does not get expanded properly. Why? + # mkdir -p "$(awk -F'=' '/^session *= */{gsub(/^ +| +$/,"",$2); gsub(/~/,"$HOME",$2); res=$2} END {printf res}' ~/.rtorrent.rc)" echo fi