#!/bin/sh

mkdir -p \
	~/Downloads/Screenshots/ ~/.local/share/common-lisp ~/tmp/ ~/.gnupg \
	~/.xmonad ~/.config/ranger/ ~/.config/guix                          \
	~/.config/khal ~/.config/khard

if [ ! -e ~/tmp/scratch.txt ]; then
	touch ~/tmp/scratch.txt
fi

ln -fs ~/dev/libre ~/common-lisp &&
	rm -f  ~/dev/libre/libre
ln -fs ~/dev/others/password-store ~/.password-store &&
	rm -f  ~/dev/others/password-store/password-store

# FIXME: guix shell --check complains about this
ln -fs "$DOTFILES/sh/bashrc.sh"                 ~/.bashrc
ln -fs "$DOTFILES/sh/bash_profile.sh"           ~/.bash_login
ln -fs "$DOTFILES/sh/bash_profile.sh"           ~/.bash_profile
ln -fs "$HOME/annex/bin/misc/nurc.sh"           ~/.nurc
ln -fs "$DOTFILES/inputrc.conf"                 ~/.inputrc
ln -fs "$DOTFILES/Xmodmap.conf"                 ~/.Xmodmap

ln -fs "$DOTFILES/vcs/hgrc.ini"                 ~/.hgrc
ln -fs "$DOTFILES/vcs/gitconfig.ini"            ~/.gitconfig
ln -fs "$HOME/annex/bin/misc/git/mrconfig.ini"  ~/.mrconfig

ln -fs "$DOTFILES/gpg/gpg.conf"                 ~/.gnupg/gpg.conf
ln -fs "$DOTFILES/gpg/gpg-agent.conf"           ~/.gnupg/gpg-agent.conf
ln -fs "$DOTFILES/gpg/sshcontrol"               ~/.gnupg/sshcontrol
ln -fs "$DOTFILES/ssh.conf"                     ~/.ssh/config

ln -fs "$DOTFILES/xmonad/xsession.sh"           ~/.xsession
ln -fs "$DOTFILES/xmonad/xmonad.hs"             ~/.xmonad/xmonad.hs
ln -fs "$DOTFILES/xmonad/xmobar.hs"             ~/.xmobarrc

ln -fs "$DOTFILES/npmrc.sh"                     ~/.npmrc
ln -fs "$DOTFILES/mailcap.conf"                 ~/.mailcap
ln -fs "$DOTFILES/tmux.conf"                    ~/.tmux.conf
ln -fs "$DOTFILES/exrc.conf"                    ~/.exrc
ln -fs "$DOTFILES/ranger.conf"                  ~/.config/ranger/rc.conf
ln -fs "$DOTFILES/infokey"                      ~/.infokey
ln -fs "$DOTFILES/sbclrc.lisp"                  ~/.sbclrc
ln -fs "$DOTFILES/guix/channels.scm"            ~/.config/guix/channels.scm
ln -fs "$HOME/annex/bin/misc/khard.conf" ~/.config/khard/khard.conf
ln -fs "$HOME/annex/bin/misc/khal.conf"  ~/.config/khal/config
