2021-03-03 01:05:58 -06:00
|
|
|
#!/usr/bin/env fish
|
|
|
|
|
|
|
|
# TODO: init from curl
|
|
|
|
|
|
|
|
set dfp (realpath (dirname (status -f))/../..)
|
|
|
|
set lock_file $HOME/.using-lytedev-dotfiles.lock
|
2021-03-06 22:07:30 -06:00
|
|
|
|
|
|
|
if not test -f $lock_file
|
|
|
|
echo This will delete existing files. Make sure you know what you\'re doing.
|
|
|
|
read -r -p "Are you sure you want to continue? [y/N] " response
|
|
|
|
set response (string lower $response)
|
|
|
|
if string match $response y
|
|
|
|
echo "agreed" > "$lock_file"
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-03-03 01:05:58 -06:00
|
|
|
set -q XDG_CONFIG_HOME || set XDG_CONFIG_HOME $HOME/.config
|
2021-03-06 22:07:30 -06:00
|
|
|
set h $HOME; set c $XDG_CONFIG_HOME
|
|
|
|
if test -d $c/lytedev-env
|
|
|
|
echo "Warning: no environment-specific configuration detected!"
|
2021-03-03 01:05:58 -06:00
|
|
|
end
|
|
|
|
|
2021-03-06 22:07:30 -06:00
|
|
|
function l -a dot -a target -d "Symlink a dotfile configuration file or directory"
|
|
|
|
if test -L $target || test -f $target || test -d $target
|
|
|
|
rm -rf "$target"
|
|
|
|
end
|
|
|
|
# check if the directory that will contain the link exists
|
|
|
|
set -l d (dirname $target)
|
|
|
|
test -d $d || mkdir -p $d
|
|
|
|
ln -s (pwd)/$dot $target
|
|
|
|
echo Linked $dot to $target
|
|
|
|
end
|
2021-03-03 01:05:58 -06:00
|
|
|
|
2021-03-06 22:07:30 -06:00
|
|
|
pushd $dfp
|
2021-03-03 01:05:58 -06:00
|
|
|
l common/tmux/conf $h/.tmux.conf
|
|
|
|
l common/fish $c/fish
|
|
|
|
l common/neovim $c/nvim
|
|
|
|
l common/colors/vim $c/nvim/colors/base16-donokai.vim
|
|
|
|
l common/weechat $h/.weechat
|
|
|
|
l common/scim/rc $h/.scimrc
|
|
|
|
l common/scim/lua $h/.scim/lua
|
|
|
|
l common/nnn $c/nnn
|
|
|
|
l common/kak $c/kak
|
|
|
|
l common/gpg/agent.conf $h/.gnupg/gpg-agent.conf
|
|
|
|
l common/htop/rc $c/htop/htoprc
|
|
|
|
l common/kitty $c/kitty
|
|
|
|
l common/mutt/rc $c/.muttrc
|
|
|
|
l common/git/config $h/.gitconfig
|
|
|
|
l common/elixir/iex.exs $h/.iex.exs
|
2021-03-06 22:07:30 -06:00
|
|
|
popd
|
2021-03-03 01:05:58 -06:00
|
|
|
|
2021-03-06 22:07:30 -06:00
|
|
|
for s in $c/lytedev-env/*/dotfiles-setup.d.fish
|
|
|
|
source $s $dfp $h $c
|
|
|
|
end
|
2021-03-03 01:05:58 -06:00
|
|
|
|
|
|
|
# execute the user's shell
|
|
|
|
set ush (getent passwd $LOGNAME | cut -d: -f7)
|
|
|
|
echo Dotfiles Installed! Running $ush
|
|
|
|
exec $ush
|