2012-07-28 19:39:12 +02:00
|
|
|
#!/bin/sh
|
2012-07-28 20:04:21 +02:00
|
|
|
## Home session initialization.
|
2014-11-12 16:15:39 +01:00
|
|
|
|
2015-07-09 12:19:34 +02:00
|
|
|
SOURCEDIR="$HOME/dataperso"
|
2012-10-29 15:29:54 +01:00
|
|
|
[ -z "$XDG_CONFIG_HOME" ] && XDG_CONFIG_HOME="$HOME/.config"
|
|
|
|
[ -z "$XDG_DATA_HOME" ] && XDG_DATA_HOME="$HOME/.local/share"
|
|
|
|
[ -z "$XDG_DATA_DIRS" ] && XDG_DATA_DIRS="/usr/local/share"
|
2012-07-28 20:04:21 +02:00
|
|
|
|
2013-05-22 17:35:54 +02:00
|
|
|
echo "==> 'temp' folder"
|
2016-06-09 21:32:07 +02:00
|
|
|
mkdir -pv "$HOME/temp"
|
2013-05-04 00:30:11 +02:00
|
|
|
|
2016-05-31 10:43:04 +02:00
|
|
|
echo "==> Abook"
|
2016-06-09 21:32:07 +02:00
|
|
|
ln -snfv "$SOURCEDIR/contacts" "$HOME/.abook"
|
2013-04-30 14:17:22 +02:00
|
|
|
|
2016-05-31 10:43:04 +02:00
|
|
|
echo "==> Mutt"
|
|
|
|
[ -d "$SOURCEDIR/mails" ] && ln -snf "$SOURCEDIR/mails" "$HOME/.mutt.d"
|
2016-06-09 21:32:07 +02:00
|
|
|
mkdir -pv "$HOME/.cache/mutt/headers"
|
|
|
|
mkdir -pv "$HOME/.cache/mutt/messages"
|
2012-07-28 20:04:21 +02:00
|
|
|
|
2016-05-31 10:43:04 +02:00
|
|
|
echo "==> To-Do"
|
2016-06-09 21:32:07 +02:00
|
|
|
ln -sfv "$SOURCEDIR/todo/todo.org" "$HOME/todo.org"
|
2012-07-28 19:39:12 +02:00
|
|
|
|
2016-05-31 10:43:04 +02:00
|
|
|
echo "==> Bookmarks"
|
|
|
|
if [ -z "$BROWSER" ]; then
|
|
|
|
echo "Cannot proceed when variable BROWSER is not set."
|
|
|
|
else
|
|
|
|
case "$BROWSER" in
|
|
|
|
dwb)
|
|
|
|
BOOKMARKS="$XDG_CONFIG_HOME/$BROWSER/default/"
|
|
|
|
QUICKMARKS="$XDG_CONFIG_HOME/$BROWSER/default/" ;;
|
|
|
|
qutebrowser)
|
2016-06-09 21:32:07 +02:00
|
|
|
mkdir -pv "$XDG_CONFIG_HOME/$BROWSER/bookmarks"
|
2016-05-31 10:43:04 +02:00
|
|
|
BOOKMARKS="$XDG_CONFIG_HOME/$BROWSER/bookmarks/urls"
|
|
|
|
QUICKMARKS="$XDG_CONFIG_HOME/$BROWSER/" ;;
|
|
|
|
*)
|
|
|
|
BOOKMARKS="$XDG_CONFIG_HOME/$BROWSER/"
|
|
|
|
QUICKMARKS="$XDG_CONFIG_HOME/$BROWSER/" ;;
|
|
|
|
esac
|
2016-06-09 21:32:07 +02:00
|
|
|
ln -sfv "$SOURCEDIR/bookmarks/bookmarks" "$BOOKMARKS"
|
|
|
|
ln -sfv "$SOURCEDIR/bookmarks/quickmarks" "$QUICKMARKS"
|
2012-11-29 16:17:06 +01:00
|
|
|
fi
|
2013-01-09 19:25:23 +01:00
|
|
|
|
2016-05-31 10:43:04 +02:00
|
|
|
echo "==> Newsbeuter"
|
2016-06-09 21:32:07 +02:00
|
|
|
mkdir -pv "$XDG_DATA_HOME/newsbeuter"
|
|
|
|
ln -sfv "$SOURCEDIR/news/urls" "$XDG_CONFIG_HOME/newsbeuter/"
|
|
|
|
ln -sfv "$SOURCEDIR/news/news_starred" "$XDG_CONFIG_HOME/newsbeuter/"
|
2013-05-05 20:57:20 +02:00
|
|
|
|
2016-05-31 10:43:04 +02:00
|
|
|
echo "==> Launchers"
|
2016-06-09 21:32:07 +02:00
|
|
|
ln -snfv "$SOURCEDIR/launchers" "$HOME/.launchers"
|
2013-10-16 14:22:01 +02:00
|
|
|
|
2016-05-31 10:43:04 +02:00
|
|
|
echo "==> Hackpool"
|
2016-06-09 21:32:07 +02:00
|
|
|
ln -snfv "$SOURCEDIR/hackpool" "$HOME/.hackpool"
|
2016-02-29 04:28:33 +01:00
|
|
|
|
2016-06-09 21:32:07 +02:00
|
|
|
echo "==> Go path"
|
2016-09-24 03:48:47 +02:00
|
|
|
mkdir -pv "$HOME/go" "$HOME/.go-tools"
|
2016-05-31 10:43:04 +02:00
|
|
|
if command -v go >/dev/null 2>&1; then
|
2016-06-09 21:32:07 +02:00
|
|
|
echo "==> Go extra dev tools"
|
2016-09-24 03:48:47 +02:00
|
|
|
export GOPATH="$HOME/.go-tools"
|
2016-05-31 10:43:04 +02:00
|
|
|
export PATH="$PATH:$GOPATH/bin"
|
2016-05-06 09:24:40 +02:00
|
|
|
## See https://dominik.honnef.co/posts/2014/12/an_incomplete_list_of_go_tools/.
|
|
|
|
## https://dominik.honnef.co/go/
|
|
|
|
go get -v \
|
2016-05-28 13:20:55 +02:00
|
|
|
github.com/client9/misspell \
|
2016-05-06 09:24:40 +02:00
|
|
|
github.com/nsf/gocode \
|
|
|
|
github.com/rogpeppe/godef \
|
|
|
|
honnef.co/go/unused/cmd/unused
|
2016-09-24 03:48:47 +02:00
|
|
|
go get -v github.com/monochromegane/the_platinum_searcher/...
|
2016-05-06 09:24:40 +02:00
|
|
|
go get -v github.com/alecthomas/gometalinter && gometalinter -i
|
2016-09-24 03:48:47 +02:00
|
|
|
strip -s "$GOPATH/bin"/*
|
2016-05-06 09:24:40 +02:00
|
|
|
fi
|
2016-06-09 21:32:07 +02:00
|
|
|
|
|
|
|
if command -v emacs >/dev/null 2>&1; then
|
|
|
|
echo "==> Emacs extra packages"
|
2016-10-06 17:33:55 +02:00
|
|
|
yes | emacs --batch -l ~/.emacs.d/init.el --eval '(progn (package-refresh-contents)(package-install-selected-packages))'
|
2016-06-09 21:32:07 +02:00
|
|
|
fi
|