#!/bin/bash cd $(dirname $0) # Some reason Linux `ln` and Mac `ln` don't support the same flags... if [ "$(uname)" == 'Darwin' ]; then lndir="ln -sfh" else lndir="ln -sfT" fi # Set up bin directory, which must be set up first $lndir "$(pwd)/bin" "$HOME/.bin" export PATH="$PATH:$HOME/.bin" export SKIN=${SKIN:-onedark} export FONT_SIZE=${FONT_SIZE:-14} # If another executable is passed, we call it now. # This is intended to be one of the install/for-* scripts. if [ -x "$1" ]; then $1 fi # Expand templates with theme variables . "themes/$SKIN" variables=$(cat "themes/$SKIN" | grep '^export' | sed 's/^export \([^=]*\).*/$\1/ ; P ; s/theme_/theme_rgb_/') for file in $(find . -name '*.template' -type f); do cd "$(dirname "$file")" export GPG_KEY_ID=$(git config user.signingkey) envsubst "$variables \$PWD \$FONT_SIZE \$GPG_KEY_ID" < "$(basename "$file")" > "$(basename "${file%.template}")" cd - >/dev/null done # Make executable any templated scripts that need to be executable chmod +x ./tmux/scripts/tmux-status-left # Then link configs for all of the installed programs dot_config () { $lndir "$(pwd)/$1" "$HOME/.config/$1" } $lndir ./base ./syncat/style/active test -d "./syncat/style/$SKIN" && ln -sf "./$SKIN/colours.syncat" "./syncat/style/colours.syncat" check broot && dot_config broot check fish && dot_config fish check flashfocus && dot_config flashfocus check hunter && dot_config hunter check joshuto && dot_config joshuto check kak && dot_config kak check kitty && dot_config kitty check mako && dot_config mako check nvim && dot_config nvim check ranger && dot_config ranger check rofi && dot_config rofi check wofi && dot_config wofi check sway && dot_config sway check swaylock && dot_config swaylock check swayidle && dot_config swayidle check hx && dot_config helix check tig && dot_config tig check zellij && dot_config zellij check topgrade && dot_config topgrade check wezterm && dot_config wezterm check rio && dot_config rio check tv && dot_config television check yazi && dot_config yazi # check hyprland && dot_config hypr # I never ended up setting this one up if [ "$(uname)" == 'Darwin' ]; then check syncat && $lndir "$(pwd)/syncat" "$HOME/Library/Preferences/com.cameldridge.syncat" else check syncat && dot_config syncat fi check waybar && dot_config waybar check alacritty && dot_config alacritty check tmux && ln -sf "$(pwd)/tmux/.tmux.conf" "$HOME/.tmux.conf" $lndir "$(pwd)/terminfo" "$HOME/.terminfo" ln -sf "$(pwd)/git/.gitconfig" "$HOME/.gitconfig" ln -sf "$(pwd)/bash/.bashrc" "$HOME/.bashrc" $lndir "$(pwd)/fonts" "$HOME/.fonts"