2020-02-17 13:13:34 +00:00
|
|
|
#!/usr/bin/env fish
|
|
|
|
|
2020-03-29 10:33:19 +00:00
|
|
|
# Prerequisite & inistalled apps
|
2020-12-20 14:23:31 +00:00
|
|
|
set prerequisiteApps bat bmon broot brave caffeine-ng exa fslint fzf graphviz isync imagemagick lightdm-gtk-greeter mailcap neofetch npm pandoc-bin pamixer playerctl pulseaudio pulsemixer python pywal ripgrep stow sxiv tldr trayer udisks2 unclutter xbanish xwallpaper yarn xprop zathura
|
2020-11-28 16:40:35 +00:00
|
|
|
set prerequisiteFonts ttf-linux-libertine noto-fonts noto-fonts-emoji ttf-liberation nerd-fonts-hack
|
2020-11-28 13:09:32 +00:00
|
|
|
set prerequisiteLibraries libxft-bgra
|
2020-06-07 18:17:21 +00:00
|
|
|
set prerequisiteLsp bash-language-server ccls php-language-server python-language-server typescript-language-server-bin vscode-css-languageserver-bin vscode-html-languageserver-bin nodejs-intelephense
|
2020-11-28 13:07:52 +00:00
|
|
|
set configuredApps alacritty bspwm castero emacs firejail git gnupg gtk lf dunst mpd mpv mpv-mpris ncmpcpp neomutt neovim picom redshift sxhkd tmux tuir weechat
|
2020-03-29 10:33:19 +00:00
|
|
|
set locales aspell-en hunspell-en_GB hunspell-en_US hunspell-nl
|
2020-06-07 18:17:21 +00:00
|
|
|
set golang go golangci-lint-bin
|
2020-06-19 09:57:52 +00:00
|
|
|
set shell shfmt shellcheck
|
2020-11-28 20:22:35 +00:00
|
|
|
set screenlock xsecurelock xss-lock
|
2020-03-29 10:33:19 +00:00
|
|
|
|
2020-02-17 13:13:34 +00:00
|
|
|
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
|
2020-03-24 15:24:16 +00:00
|
|
|
echo "Installing omf package $argv"
|
2020-02-17 13:13:34 +00:00
|
|
|
omf install "$argv"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-06-07 18:17:21 +00:00
|
|
|
function install_yarn_package_if_not_exist
|
|
|
|
if ! yarn global list lighthouse >/dev/null 2>&1
|
|
|
|
echo "Installing yarn package $argv"
|
|
|
|
yarn global add "$argv"
|
2020-03-24 15:24:16 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-03-29 10:33:19 +00:00
|
|
|
function install_app_if_not_exist
|
|
|
|
if test (pacman -Q | grep -c "$argv") -eq 0
|
|
|
|
echo "Installing missing package $argv"
|
|
|
|
yay -S --noconfirm "$argv"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
for app in $prerequisiteApps
|
|
|
|
install_app_if_not_exist "$app"
|
|
|
|
end
|
|
|
|
|
|
|
|
for font in $prerequisiteFonts
|
|
|
|
install_app_if_not_exist "$font"
|
|
|
|
end
|
|
|
|
|
2020-07-06 15:07:22 +00:00
|
|
|
for library in $prerequisiteLibraries
|
|
|
|
install_app_if_not_exist "$library"
|
|
|
|
end
|
|
|
|
|
2020-03-29 10:33:19 +00:00
|
|
|
for lsp in $prerequisiteLsp
|
|
|
|
install_app_if_not_exist "$lsp"
|
|
|
|
end
|
|
|
|
|
|
|
|
for app in $configuredApps
|
|
|
|
install_app_if_not_exist "$app"
|
|
|
|
end
|
|
|
|
|
|
|
|
for locale in $locales
|
|
|
|
install_app_if_not_exist "$locale"
|
|
|
|
end
|
|
|
|
|
2020-06-07 18:17:21 +00:00
|
|
|
for go in $golang
|
|
|
|
install_app_if_not_exist "$go"
|
|
|
|
end
|
|
|
|
|
2020-06-19 09:57:52 +00:00
|
|
|
for sh in $shell
|
|
|
|
install_app_if_not_exist "$sh"
|
|
|
|
end
|
|
|
|
|
2020-11-28 20:22:35 +00:00
|
|
|
for lock in $screenlock
|
|
|
|
install_app_if_not_exist "$lock"
|
|
|
|
end
|
2020-06-19 09:57:52 +00:00
|
|
|
|
2020-02-17 13:13:34 +00:00
|
|
|
# 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
|
2020-03-29 17:12:00 +00:00
|
|
|
mkdir_if_not_exist ~/.config/git
|
2020-04-14 14:33:49 +00:00
|
|
|
mkdir_if_not_exist ~/.config/msmtp
|
2020-02-17 13:13:34 +00:00
|
|
|
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-04-14 14:33:49 +00:00
|
|
|
mkdir_if_not_exist ~/.config/systemd/user
|
2020-02-18 01:32:08 +00:00
|
|
|
mkdir_if_not_exist ~/.config/wal
|
2020-03-29 17:12:00 +00:00
|
|
|
mkdir_if_not_exist ~/.config/weechat
|
2020-03-25 09:26:34 +00:00
|
|
|
mkdir_if_not_exist ~/.config/X11
|
2020-03-29 17:12:00 +00:00
|
|
|
mkdir_if_not_exist ~/.gnupg
|
2020-04-12 08:45:52 +00:00
|
|
|
mkdir_if_not_exist ~/.config/mpv/scripts
|
2020-06-01 17:25:59 +00:00
|
|
|
mkdir_if_not_exist ~/.config/coc/extensions
|
2020-07-24 10:24:25 +00:00
|
|
|
mkdir_if_not_exist ~/.config/dmenu-frecency
|
2020-11-22 10:22:53 +00:00
|
|
|
mkdir_if_not_exist ~/.config/doom
|
2020-12-20 14:23:31 +00:00
|
|
|
mkdir_if_not_exist ~/.config/sxhkd
|
2020-06-01 17:25:59 +00:00
|
|
|
|
2020-04-12 08:45:52 +00:00
|
|
|
|
|
|
|
# Link mpv plugins if they don't exist
|
|
|
|
if [ ! -h ~/.config/mpv/scripts/mpris.so ]
|
|
|
|
echo "Linking mpris.so"
|
|
|
|
ln -s /usr/lib/mpv/mpris.so ~/.config/mpv/scripts/mpris.so
|
|
|
|
end
|
2020-02-17 13:13:34 +00:00
|
|
|
|
2020-11-27 05:40:29 +00:00
|
|
|
for d in (find -- */ -maxdepth 0 -type d | grep -v node_modules | cut -f1 -d '/')
|
2020-02-17 13:13:34 +00:00
|
|
|
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
|
2020-04-10 08:47:09 +00:00
|
|
|
install_omf_package_if_not_exist spacefish
|
2020-02-17 13:13:34 +00:00
|
|
|
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 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
|
|
|
|
2020-11-27 05:40:29 +00:00
|
|
|
# Install Neovim plugins
|
2020-03-14 00:16:44 +00:00
|
|
|
nvim +PlugInstall +qall
|
2020-02-23 01:21:16 +00:00
|
|
|
|
2020-06-01 17:25:59 +00:00
|
|
|
# Install Neovim coc extensions
|
|
|
|
yarn --cwd ~/.config/coc/extensions install
|
|
|
|
|
2020-06-07 18:17:21 +00:00
|
|
|
# Install yarn packages
|
|
|
|
install_yarn_package_if_not_exist lighthouse
|
2020-03-24 15:24: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
|
|
|
|
|
2020-03-08 14:48:20 +00:00
|
|
|
# Polybar scripts if not installed already
|
|
|
|
if [ ! -d ~/.local/share/polybar-scripts ]
|
|
|
|
git clone https://github.com/polybar/polybar-scripts ~/.local/share/polybar-scripts
|
|
|
|
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
|