diff --git a/files/kitty/.config/kitty/kitty.conf b/files/kitty/.config/kitty/kitty.conf index 995b5ab..b00e188 100644 --- a/files/kitty/.config/kitty/kitty.conf +++ b/files/kitty/.config/kitty/kitty.conf @@ -28,10 +28,13 @@ hide_window_decorations yes tab_bar_min_tabs 2 tab_bar_edge top -tab_bar_margin_width 5.0 -tab_bar_margin_height 5.0 -5.0 -tab_bar_align center -tab_title_template "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title} " +tab_bar_margin_width 2.0 +tab_bar_margin_height 5.0 0.0 +tab_bar_align left +tab_bar_style separator +tab_separator " | " +tab_title_template "{title}" +active_tab_title_template "{fmt.noitalic}{title}" # active_tab_foreground #000 # active_tab_background #000 # active_tab_font_style bold-italic diff --git a/files/tmux/.tmux.conf b/files/tmux/.tmux.conf index 7e476d3..4f9ea5d 100644 --- a/files/tmux/.tmux.conf +++ b/files/tmux/.tmux.conf @@ -25,7 +25,7 @@ bind-key -n M-k select-pane -U bind-key -n M-l select-pane -R # pane zoom -bind-key -n M-z resize-pane -Z +bind-key -n M-f resize-pane -Z # window rename bind-key -n M-, command-prompt -p "Rename tab:" "rename-window '%%'" @@ -62,7 +62,7 @@ bind-key -n 'M-K' resize-pane -U 5 bind-key -n 'M-J' resize-pane -D 5 # popups -bind-key -n M-f if-shell -F '#{==:#{session_name},popup}' { +bind-key -n M-p if-shell -F '#{==:#{session_name},popup}' { detach-client } { display-popup -E -w 70% -h 70% "tmux new-session -A -s popup" @@ -96,13 +96,15 @@ set-option -g set-titles on set-option -g set-titles-string "#H: #W" # Pane borders -set -g pane-border-style fg=#c3c6b2 -set -g pane-active-border-style fg=#8da101 +set -g pane-border-style fg=#dadbd2 +set -g pane-active-border-style fg=#96a193 set -g pane-border-status top +set -g pane-border-indicators off set -g pane-border-lines single set -g pane-border-format " #{?pane_active,#[bold],#[fg=#c3c6b2]}#{pane_index} " # Status +set -g status-position top set -g status-style bg=default set -g message-style bg=default set -g status-right "#[fg=yellow]#H(#S) #[fg=blue]#{=100:pane_current_path}#[fg=black]" @@ -111,3 +113,12 @@ set -g status-left "" set -g window-status-format "#[fg=#c3c6b2]#I:#W#[fg=default] " set -g window-status-current-format "#I:#W " +# Cooler status +set -g @tmux-dotbar-bg "#fdf6e3" +set -g @tmux-dotbar-fg "#5c6a72" +set -g @tmux-dotbar-fg-current "#8da101" +set -g @tmux-dotbar-fg-session "#96a193" +set -g @tmux-dotbar-fg-prefix "#e66868" +set -g @tmux-dotbar-fg-zoomed "#3a94c5" +set -g @tmux-dotbar-rounded true +run ~/.dots/scripts/dotbar.tmux diff --git a/scripts/dotbar.tmux b/scripts/dotbar.tmux new file mode 100755 index 0000000..ff4d5f0 --- /dev/null +++ b/scripts/dotbar.tmux @@ -0,0 +1,122 @@ +#!/usr/bin/env bash + +# Original source: +# https://github.com/vaaleyard/tmux-dotbar + +get_tmux_option() { + local option="$1" + local default_value="$2" + local option_value + option_value=$(tmux show-options -gqv "$option") + [ -n "$option_value" ] && echo "$option_value" || echo "$default_value" +} + +# Colors +bg=$(get_tmux_option "@tmux-dotbar-bg" '#0B0E14') +fg=$(get_tmux_option "@tmux-dotbar-fg" '#475266') +fg_current=$(get_tmux_option "@tmux-dotbar-fg-current" '#BFBDB6') +fg_session=$(get_tmux_option "@tmux-dotbar-fg-session" '#565B66') +fg_prefix=$(get_tmux_option "@tmux-dotbar-fg-prefix" '#95E6CB') +fg_zoomed=$(get_tmux_option "@tmux-dotbar-fg-zoomed" '#39BAE6') + +# Options +bold_status=$(get_tmux_option "@tmux-dotbar-bold-status" false) +bold_current_window=$(get_tmux_option "@tmux-dotbar-bold-current-window" false) +bold_session=$(get_tmux_option "@tmux-dotbar-bold-session" false) +bold_status_right=$(get_tmux_option "@tmux-dotbar-bold-status-right" false) +rounded=$(get_tmux_option "@tmux-dotbar-rounded" true) +status=$(get_tmux_option "@tmux-dotbar-position" "bottom") +justify=$(get_tmux_option "@tmux-dotbar-justify" "absolute-centre") +left_state=$(get_tmux_option "@tmux-dotbar-left" true) +right_state=$(get_tmux_option "@tmux-dotbar-right" false) + +# Status Components +session_text=$(get_tmux_option "@tmux-dotbar-session-text" " #S ") +session_position=$(get_tmux_option "@tmux-dotbar-session-position" "left") +time_text=$(get_tmux_option "@tmux-dotbar-status-right-text" " %H:%M ") + +session_bold_attr="nobold" +[ "$bold_session" = true ] && session_bold_attr="bold" + +status_right_bold_attr="nobold" +[ "$bold_status_right" = true ] && status_right_bold_attr="bold" + +prefix_bold_attr="bold" +if [ "$bold_status" = true ]; then + session_bold_attr="bold" + status_right_bold_attr="bold" + prefix_bold_attr="nobold" +fi + +if [ "$rounded" = "true" ]; then + edge_left='' + edge_right='' + # Trim 1 char from each side so edge glyphs replace the padding, keeping width stable. + # Bash does not allow negative substring lengths, so compute a safe explicit length. + if [ "${#session_text}" -gt 2 ]; then + session_text_inner="${session_text:1:${#session_text}-2}" + else + session_text_inner="$session_text" + fi + session_component="#[bg=$bg,fg=$fg_session,$session_bold_attr]#{?client_prefix,#[fg=$fg_prefix]$edge_left,$session_text}#[bg=$fg_prefix,fg=$bg,$prefix_bold_attr]#{?client_prefix,$session_text_inner,}#[bg=$bg,fg=${fg_session},$session_bold_attr]#{?client_prefix,#[fg=$fg_prefix]$edge_right,}" +else + session_component="#[bg=$bg,fg=$fg_session,$session_bold_attr]#{?client_prefix,,$session_text}#[bg=$fg_prefix,fg=$bg,$prefix_bold_attr]#{?client_prefix,$session_text,}#[bg=$bg,fg=${fg_session},$session_bold_attr]" +fi +time_component="#[bg=$bg,fg=$fg_session,$status_right_bold_attr]$time_text#[bg=$bg,fg=${fg_session},$status_right_bold_attr]" + +# Build Default Status Strings +if [ "$session_position" = "right" ]; then + default_left="" + [ "$right_state" = "true" ] && default_right="$time_component$session_component" || default_right="$session_component" +else + default_left="$session_component" + [ "$right_state" = "true" ] && default_right="$time_component" || default_right="" +fi + +status_left=$(get_tmux_option "@tmux-dotbar-status-left" "$default_left") +status_right=$(get_tmux_option "@tmux-dotbar-status-right" "$default_right") + +[ "$left_state" != "true" ] && status_left="" +([ "$right_state" != "true" ] && [ "$session_position" != "right" ]) && status_right="" + +# Window Format & SSH +base_window_format=$(get_tmux_option "@tmux-dotbar-window-status-format" ' #W ') +ssh_enabled=$(get_tmux_option "@tmux-dotbar-ssh-enabled" true) + +if [ "$ssh_enabled" = true ]; then + ssh_icon=$(get_tmux_option "@tmux-dotbar-ssh-icon" '󰌘') + ssh_icon_only=$(get_tmux_option "@tmux-dotbar-ssh-icon-only" false) + if [ "$ssh_icon_only" = true ]; then + ssh_window_format=" ${ssh_icon}${base_window_format}" + else + ssh_window_format=" ${ssh_icon} #(host=\$(echo '#{pane_title}' | sed 's/^ssh //; s/ .*//; s/.*@//; s/:.*//'); if echo \"\$host\" | grep -qE '^[0-9.]+\$|^[0-9]'; then echo '#W'; else echo \"\$host\"; fi | cut -c1-20) " + fi + window_status_format="#{?#{==:#{pane_current_command},ssh},${ssh_window_format},${base_window_format}}" +else + window_status_format="${base_window_format}" +fi + +window_status_separator=$(get_tmux_option "@tmux-dotbar-window-status-separator" ' • ') +maximized_pane_icon=$(get_tmux_option "@tmux-dotbar-maximized-icon" '󰊓') +show_maximized_icon_for_all_tabs=$(get_tmux_option "@tmux-dotbar-show-maximized-icon-for-all-tabs" false) + +# Apply Options +tmux set-option -g status-position "$status" +tmux set-option -g status-justify "$justify" +tmux set-option -g status-left "$status_left" +tmux set-option -g status-right "$status_right" +tmux set-window-option -g window-status-separator "$window_status_separator" +tmux set-option -g window-status-style "bg=${bg},fg=${fg}" +tmux set-option -g window-status-format "$window_status_format" +[ "$show_maximized_icon_for_all_tabs" = true ] && tmux set-option -g window-status-format "${window_status_format}#{?window_zoomed_flag,${maximized_pane_icon},}" + +status_style="bg=${bg},fg=${fg}" +[ "$bold_status" = true ] && status_style="$status_style,bold" +tmux set-option -g status-style "$status_style" + +tmux set-option -g window-status-bell-style "bg=${fg_prefix},fg=${bg},bold" +tmux set-option -g window-status-activity-style "bg=${fg_current},fg=${bg}" + +current_format="#[bg=${bg},fg=${fg_current}]${window_status_format}#[fg=${fg_zoomed},bg=${bg}]#{?window_zoomed_flag,${maximized_pane_icon},}#[fg=${bg},bg=default]" +[ "$bold_current_window" = true ] && current_format="#[bg=${bg},fg=${fg_current},bold]${window_status_format}#[fg=#39BAE6,bg=${bg}]#{?window_zoomed_flag,${maximized_pane_icon},}#[fg=${bg},bg=default]" +tmux set-option -g window-status-current-format "$current_format"