diff --git a/fish/.config/fish/config.fish.symlink b/fish/.config/fish/config.fish.symlink index 89b00a1..3543625 100644 --- a/fish/.config/fish/config.fish.symlink +++ b/fish/.config/fish/config.fish.symlink @@ -2,7 +2,9 @@ # Remove that annoying 'last logged in' message. # Tested this method vs in iTerm settings - latter is less portable and slower. -printf '\33c\e[3J' +if status is-login + printf '\33c\e[3J' +end # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/script/dot b/script/dot old mode 100644 new mode 100755 index c02e6cd..84bcd6a --- a/script/dot +++ b/script/dot @@ -25,9 +25,6 @@ function link_file set -f src $argv[1] set -f dst $argv[2] - set -f overwrite false - set -f backup false - set -f skip false set -f action if [ -f "$dst" ] || [ -d "$dst" ] || [ -L "$dst" ] @@ -36,24 +33,25 @@ function link_file set -f current_src (readlink "$dst") if [ "$current_src" = "$src" ] - set skip true + set -f skip true else - print_question "File already exists: $dst ($(basename $src)), what do you want to do?\n([s]kip, [S]kip all, [o]verwrite, [O]verwrite all, [b]ackup, [B]ackup all)" + print_question "File already exists: $dst ($(basename $src)), what do you want to do?" + print_question "([s]kip, [S]kip all, [o]verwrite, [O]verwrite all, [b]ackup, [B]ackup all)" read -n 1 action switch $action case o - set overwrite true + set -f overwrite true case O - set overwrite_all true + set -f overwrite_all true case b - set backup true + set -f backup true case B - set backup_all true + set -f backup_all true case s - set skip true + set -f skip true case S - set skip_all true + set -f skip_all true end end end @@ -83,17 +81,17 @@ function link_file mkdir -p (string replace -r '\/[^\/]+$' '' "$dst") end - ln -s "$src" "$dst" + ln -s "$src" "$dst" &> /dev/null print_success "Linked $src to $dst" end end function make_dst - set -l path (string escape --style=regex "$DOT") - set -l regex (string join '^\/' $path '\/[a-zA-Z]+\/(.+)\.symlink$') + set -l path (string replace -a '/' '\/' "$DOT") + set -l regex (string join '' '^' "$path" '\/[a-zA-Z]+\/(.+)\.symlink$') set -l dst (string replace -r $regex '$1' "$argv[1]") - printf '%s' "$dst" + printf '%s' "$HOME/$dst" end function install_dotfiles @@ -103,8 +101,9 @@ function install_dotfiles set -g backup_all false set -g skip_all false - find -H "$DOT" -name "*.symlink" -not -path ".git" | \ - while read -l -t src; link_file "$src" "$(make_dst $src)"; end + for src in (find -H "$DOT" -name "*.symlink" -not -path ".git") + link_file $src (make_dst $src) + end end ################################################################################ diff --git a/script/utils b/script/utils old mode 100644 new mode 100755 diff --git a/tmux/.tmux.conf.symlink b/tmux/.tmux.conf.symlink new file mode 100644 index 0000000..dad7283 --- /dev/null +++ b/tmux/.tmux.conf.symlink @@ -0,0 +1,34 @@ +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-resurrect' +set -g @plugin 'catppuccin/tmux' + +set -g @catppuccin_flavour 'mocha' + +set -g @catppuccin_window_left_separator "" +set -g @catppuccin_window_right_separator " " +set -g @catppuccin_window_middle_separator " █" +set -g @catppuccin_window_number_position "right" + +set -g @catppuccin_window_default_fill "number" +set -g @catppuccin_window_default_text "#W" + +set -g @catppuccin_window_current_fill "number" +set -g @catppuccin_window_current_text "#W" + +set -g @catppuccin_status_modules_right "directory user host session" +set -g @catppuccin_status_left_separator " " +set -g @catppuccin_status_right_separator "" +set -g @catppuccin_status_right_separator_inverse "no" +set -g @catppuccin_status_fill "icon" +set -g @catppuccin_status_connect_separator "no" + +set -g @catppuccin_directory_text "#{pane_current_path}" + +# Install tpm if not already installed. +if "test ! -d ~/.tmux/plugins/tpm" \ + "run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'" + +# Init tmux plugin manager. +# Must be very last line!! +run '~/.tmux/plugins/tpm/tpm' diff --git a/tmux/install.fish b/tmux/install.fish new file mode 100755 index 0000000..9d21400 --- /dev/null +++ b/tmux/install.fish @@ -0,0 +1,2 @@ +#!/usr/bin/env fish +