1
0
mirror of https://github.com/alrayyes/dotfiles/ synced 2023-11-14 15:56:30 +00:00
dotfiles/install

88 lines
2.5 KiB
Plaintext
Raw Normal View History

2020-02-17 13:13:34 +00:00
#!/usr/bin/env fish
function mkdir_if_not_exist
if [ ! -d "$argv" ]
echo "Creating directory $argv"
mkdir -p "$argv"
end
end
function install_omf_package_if_not_exist
if test (omf list | grep -c "$argv") -eq 0
omf install "$argv"
end
end
# Create directories that need to exist
mkdir_if_not_exist ~/.cache/mpd
mkdir_if_not_exist ~/.config/alacritty
mkdir_if_not_exist ~/.config/nvim
mkdir_if_not_exist ~/.config/fish
mkdir_if_not_exist ~/.config/omf
2020-03-08 21:03:25 +00:00
mkdir_if_not_exist ~/.config/polybar/bin
2020-02-17 13:13:34 +00:00
mkdir_if_not_exist ~/.config/mpd
2020-02-18 01:32:08 +00:00
mkdir_if_not_exist ~/.config/wal
2020-02-17 13:13:34 +00:00
mkdir_if_not_exist ~/.weechat
for d in (find -- */ -maxdepth 0 -type d | cut -f1 -d '/')
echo "Linking $d..."
stow -t "$HOME" "$d"
end
2020-02-02 17:40:52 +00:00
2020-02-14 15:03:21 +00:00
# Refresh xgd
2020-02-17 13:13:34 +00:00
if test (grep -c 'x-scheme-handler/org-protocol=org-protocol.desktop' ~/.config/mimeapps.list) -eq 0
echo "Refreshing xgd to handle org-protocol"
update-desktop-database ~/.local/share/applications/
xdg-mime default org-protocol.desktop x-scheme-handler/org-protocol
end
2020-02-14 15:03:21 +00:00
2020-02-17 13:13:34 +00:00
# Install oh-my-fish if it isn't installed
if [ ! -d ~/.local/share/omf ]
curl -L https://get.oh-my.fish | fish
end
# Install oh-my-fish plugins
install_omf_package_if_not_exist bobthefish
install_omf_package_if_not_exist colored-man-pages
install_omf_package_if_not_exist extract
install_omf_package_if_not_exist fzf
install_omf_package_if_not_exist gi
install_omf_package_if_not_exist git-flow
install_omf_package_if_not_exist sudope
install_omf_package_if_not_exist wttr
2020-02-14 15:50:49 +00:00
2020-02-14 15:03:21 +00:00
# Install vim plugins & requirements
2020-02-17 13:13:34 +00:00
if test (pip list --user | grep -c 'pynvim') -ne 1
pip install --user pynvim
end
2020-02-14 15:03:21 +00:00
2020-02-14 15:50:49 +00:00
# Install plug package manager if it doesn't exist
2020-02-17 13:13:34 +00:00
if [ ! -d ~/.config/nvim/plugged ]
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
end
2020-02-14 15:03:21 +00:00
# Install Neovim plugins
nvim +PlugInstall +qall
2020-02-23 01:21:16 +00:00
2020-02-17 13:13:34 +00:00
# Setup broot if not done already
if [ ! -d ~/.local/share/broot ]
broot --install
end
# Polybar scripts if not installed already
if [ ! -d ~/.local/share/polybar-scripts ]
git clone https://github.com/polybar/polybar-scripts ~/.local/share/polybar-scripts
else
git --work-tree=$HOME/.local/share/polybar-scripts pull
end
2020-02-17 13:13:34 +00:00
# Update fish completions (auto generated from man pages)
fish_update_completions
2020-02-14 15:03:21 +00:00
# Notify user to manually symlink files
2020-02-17 13:13:34 +00:00
if [ -n "$argv[1]" ]
printf "\n\nDon't forget to symlink these files:\n\n"
find ~ \( -type l -o -type f \) -name "*.$argv[1]" -exec ls -al {} \;
end