73 lines
2.2 KiB
Bash
Executable File
73 lines
2.2 KiB
Bash
Executable File
#!/bin/sh
|
|
## Home session initialization.
|
|
|
|
SOURCEDIR="$HOME/dataperso"
|
|
[ -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"
|
|
|
|
echo "==> 'temp' folder"
|
|
mkdir -pv "$HOME/temp"
|
|
|
|
echo "==> Abook"
|
|
ln -snfv "$SOURCEDIR/contacts" "$HOME/.abook"
|
|
|
|
echo "==> Mutt"
|
|
[ -d "$SOURCEDIR/mails" ] && ln -snf "$SOURCEDIR/mails" "$HOME/.mutt.d"
|
|
mkdir -pv "$HOME/.cache/mutt/headers"
|
|
mkdir -pv "$HOME/.cache/mutt/messages"
|
|
|
|
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)
|
|
mkdir -pv "$XDG_CONFIG_HOME/$BROWSER/bookmarks"
|
|
BOOKMARKS="$XDG_CONFIG_HOME/$BROWSER/bookmarks/urls"
|
|
QUICKMARKS="$XDG_CONFIG_HOME/$BROWSER/" ;;
|
|
*)
|
|
BOOKMARKS="$XDG_CONFIG_HOME/$BROWSER/"
|
|
QUICKMARKS="$XDG_CONFIG_HOME/$BROWSER/" ;;
|
|
esac
|
|
ln -sfv "$SOURCEDIR/bookmarks/bookmarks" "$BOOKMARKS"
|
|
ln -sfv "$SOURCEDIR/bookmarks/quickmarks" "$QUICKMARKS"
|
|
fi
|
|
|
|
echo "==> Newsbeuter"
|
|
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/"
|
|
|
|
echo "==> Launchers"
|
|
ln -snfv "$SOURCEDIR/launchers" "$HOME/.launchers"
|
|
|
|
echo "==> Hackpool"
|
|
ln -snfv "$SOURCEDIR/hackpool" "$HOME/.hackpool"
|
|
|
|
echo "==> Go path"
|
|
mkdir -pv "$HOME/go" "$HOME/.go-tools"
|
|
if command -v go >/dev/null 2>&1; then
|
|
echo "==> Go extra dev tools"
|
|
export GOPATH="$HOME/.go-tools"
|
|
export PATH="$PATH:$GOPATH/bin"
|
|
## See https://dominik.honnef.co/posts/2014/12/an_incomplete_list_of_go_tools/.
|
|
## https://dominik.honnef.co/go/
|
|
go get -v \
|
|
github.com/client9/misspell \
|
|
github.com/nsf/gocode \
|
|
github.com/rogpeppe/godef \
|
|
honnef.co/go/unused/cmd/unused
|
|
go get -v github.com/monochromegane/the_platinum_searcher/...
|
|
go get -v github.com/alecthomas/gometalinter && gometalinter -i
|
|
strip -s "$GOPATH/bin"/*
|
|
fi
|
|
|
|
if command -v emacs >/dev/null 2>&1; then
|
|
echo "==> Emacs extra packages"
|
|
yes | emacs --batch -l ~/.emacs.d/init.el --eval '(progn (package-refresh-contents)(package-install-selected-packages))'
|
|
fi
|