Compare commits
6 Commits
c08e57e256
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| c0bb8b5f9a | |||
| a7246fe879 | |||
| e53b81fe55 | |||
| dd47827e13 | |||
| 1ec7aff593 | |||
| 04b03d85cd |
Executable
+54
@@ -0,0 +1,54 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# tmux-session-name.sh — Auto-name new tmux sessions with emoji + codename
|
||||||
|
#
|
||||||
|
# Called by the session-created hook in .tmux.conf
|
||||||
|
# Usage: tmux-session-name.sh <current_session_name> <session_id>
|
||||||
|
|
||||||
|
CURRENT_NAME="${1:-}"
|
||||||
|
SESSION_ID="${2:-}"
|
||||||
|
|
||||||
|
# Skip if name is empty or not a plain number (user explicitly named it)
|
||||||
|
if [[ -z "$CURRENT_NAME" || ! "$CURRENT_NAME" =~ ^[0-9]+$ ]]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ── Name pool ─────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
EMOJIS=(
|
||||||
|
"⚡" "🔥" "🌙" "🚀" "🎯" "💎" "🌊" "🎸" "🦊" "🐉"
|
||||||
|
"🌟" "🎭" "🔮" "🦋" "🌸" "🏔️" "🎪" "🦁" "🐺" "🦅"
|
||||||
|
"🐬" "🌋" "⚗️" "🧠" "🔭" "🎲" "🏹" "🌀" "🦄" "🐙"
|
||||||
|
"🎮" "🛸" "🌈" "🔱" "⚜️" "🧬" "🦾" "💫" "🎆" "🌌"
|
||||||
|
)
|
||||||
|
|
||||||
|
ADJECTIVES=(
|
||||||
|
swift blazing cosmic silent wild golden dark frozen epic neon
|
||||||
|
cyber ghost storm iron crystal hyper zen rogue nova apex
|
||||||
|
void shadow turbo lunar sonic electric primal ancient savage brave
|
||||||
|
mystic toxic ultra prime omega alpha delta sigma raging burning
|
||||||
|
)
|
||||||
|
|
||||||
|
NOUNS=(
|
||||||
|
wolf phoenix raven otter falcon dragon viper lynx shark cobra
|
||||||
|
titan spectre nexus cipher forge matrix pulse blade hawk panther
|
||||||
|
manta kraken hydra mantis raptor condor jaguar orca wraith banshee
|
||||||
|
golem oracle anvil tempest quasar nebula comet prism zenith apex
|
||||||
|
)
|
||||||
|
|
||||||
|
# ── Pick random combination ───────────────────────────────────────────────────
|
||||||
|
|
||||||
|
# We use absolute arithmetic expansion to avoid negative index quirks
|
||||||
|
EMOJI="${EMOJIS[$((RANDOM % ${#EMOJIS[@]}))]}"
|
||||||
|
ADJ="${ADJECTIVES[$((RANDOM % ${#ADJECTIVES[@]}))]}"
|
||||||
|
NOUN="${NOUNS[$((RANDOM % ${#NOUNS[@]}))]}"
|
||||||
|
NEW_NAME="${EMOJI} ${ADJ}-${NOUN}"
|
||||||
|
|
||||||
|
# ── Rename ────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
if [[ -n "$SESSION_ID" ]]; then
|
||||||
|
# Use -t with the specific session ID to avoid targeting the wrong session
|
||||||
|
tmux rename-session -t "$SESSION_ID" "$NEW_NAME" 2>/dev/null
|
||||||
|
else
|
||||||
|
# Called standalone — just print the name
|
||||||
|
echo "$NEW_NAME"
|
||||||
|
fi
|
||||||
@@ -5,6 +5,9 @@
|
|||||||
export EDITOR='nvim'
|
export EDITOR='nvim'
|
||||||
export VISUAL='nvim'
|
export VISUAL='nvim'
|
||||||
|
|
||||||
|
# Dotfiles root — used by scripts and tmux hooks
|
||||||
|
export DOTFILES="$HOME/dotfiles"
|
||||||
|
|
||||||
# Man page rendering
|
# Man page rendering
|
||||||
export MANROFFOPT="-c"
|
export MANROFFOPT="-c"
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ fi
|
|||||||
eval "$(fzf --bash)"
|
eval "$(fzf --bash)"
|
||||||
[[ -f ~/.fzf.zsh ]] && source ~/.fzf.zsh
|
[[ -f ~/.fzf.zsh ]] && source ~/.fzf.zsh
|
||||||
|
|
||||||
|
|
||||||
# Zoxide (smarter cd) — in case not already initialized by bashrc
|
# Zoxide (smarter cd) — in case not already initialized by bashrc
|
||||||
if [[ -n "$ZSH_VERSION" ]]; then
|
if [[ -n "$ZSH_VERSION" ]]; then
|
||||||
command -v zoxide >/dev/null && eval "$(zoxide init zsh)"
|
command -v zoxide >/dev/null && eval "$(zoxide init zsh)"
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export PATH="/Users/jsarthak/.antigravity/antigravity/bin:$PATH"
|
|||||||
|
|
||||||
# Flutter SDK
|
# Flutter SDK
|
||||||
export PATH="/Users/jsarthak/flutter-sdk/flutter/bin:$PATH"
|
export PATH="/Users/jsarthak/flutter-sdk/flutter/bin:$PATH"
|
||||||
|
export PATH="/Users/jsarthak/.local/bin:$PATH"
|
||||||
|
|
||||||
# fzf shell integration (macOS path)
|
# fzf shell integration (macOS path)
|
||||||
source <(fzf --zsh) 2>/dev/null || true
|
source <(fzf --zsh) 2>/dev/null || true
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# starship.toml - Fully riced modern prompt config aligned with Carbonfox theme
|
# starship.toml - Fully riced modern prompt config aligned with Carbonfox theme
|
||||||
|
|
||||||
format = """
|
format = """
|
||||||
$os$username$hostname$directory$git_branch$git_state$git_status$python$nodejs$rust$golang$cmd_duration$line_break\
|
$os$username$hostname$directory$git_branch$git_state$git_status$cmd_duration$line_break\
|
||||||
$character"""
|
$character"""
|
||||||
|
|
||||||
# Wait 10 milliseconds for starship to check files under the current directory.
|
# Wait 10 milliseconds for starship to check files under the current directory.
|
||||||
@@ -29,7 +29,7 @@ disabled = false
|
|||||||
|
|
||||||
[directory]
|
[directory]
|
||||||
style = "bold blue" # Use terminal blue
|
style = "bold blue" # Use terminal blue
|
||||||
format = "in [ $path]($style)[$read_only]($read_only_style) "
|
format = "in [ $path]($style)[$read_only]($read_only_style) "
|
||||||
truncation_length = 3
|
truncation_length = 3
|
||||||
truncation_symbol = "…/"
|
truncation_symbol = "…/"
|
||||||
truncate_to_repo = true
|
truncate_to_repo = true
|
||||||
@@ -44,12 +44,12 @@ vimcmd_symbol = "[❮](bold cyan)" # Use terminal cyan
|
|||||||
[git_branch]
|
[git_branch]
|
||||||
symbol = "🌱 "
|
symbol = "🌱 "
|
||||||
style = "bold red" # Use terminal red
|
style = "bold red" # Use terminal red
|
||||||
format = "on [$symbol$branch]($style) "
|
format = "on [$symbol $branch]($style) "
|
||||||
truncation_symbol = ""
|
truncation_symbol = ""
|
||||||
|
|
||||||
[git_status]
|
[git_status]
|
||||||
style = "bold red"
|
style = "bold red"
|
||||||
format = "([$all_status$ahead_behind]($style) )"
|
format = "([$all_status $ahead_behind]($style) )"
|
||||||
conflicted = "🏳"
|
conflicted = "🏳"
|
||||||
ahead = "🏎💨"
|
ahead = "🏎💨"
|
||||||
behind = "😰"
|
behind = "😰"
|
||||||
@@ -88,7 +88,7 @@ format = "via [$symbol$version]($style) "
|
|||||||
[cmd_duration]
|
[cmd_duration]
|
||||||
min_time = 100
|
min_time = 100
|
||||||
style = "bold yellow"
|
style = "bold yellow"
|
||||||
format = "underwent [$duration]($style) "
|
format = "took [$duration]($style) "
|
||||||
|
|
||||||
[status]
|
[status]
|
||||||
style = "bg:blue"
|
style = "bg:blue"
|
||||||
|
|||||||
+28
-5
@@ -181,7 +181,7 @@ tmux_conf_theme_window_status_attr="none"
|
|||||||
# tmux_conf_theme_window_status_format="#I #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}"
|
# tmux_conf_theme_window_status_format="#I #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}"
|
||||||
#tmux_conf_theme_window_status_format="#{circled_window_index} #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}"
|
#tmux_conf_theme_window_status_format="#{circled_window_index} #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}"
|
||||||
# tmux_conf_theme_window_status_format=" #I: #(despell -e #W) #W #{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,🔔,}#{?window_zoomed_flag,🔍,}"
|
# tmux_conf_theme_window_status_format=" #I: #(despell -e #W) #W #{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,🔔,}#{?window_zoomed_flag,🔍,}"
|
||||||
tmux_conf_theme_window_status_format="#[fg=$color_light_gray,bg=default]#I: #(bash /Users/jsarthak/dotfiles/tmux/tmux-window-name.sh '#W' '#{pane_current_path}')#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,🔔,}#{?window_zoomed_flag,🔍,}"
|
tmux_conf_theme_window_status_format="#[fg=$color_light_gray,bg=default]#I: #(bash $HOME/dotfiles/tmux/tmux-window-name.sh '#W' '#{pane_current_path}')#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,🔔,}#{?window_zoomed_flag,🔍,}"
|
||||||
|
|
||||||
# window current status style
|
# window current status style
|
||||||
# - built-in variables are:
|
# - built-in variables are:
|
||||||
@@ -196,7 +196,7 @@ tmux_conf_theme_window_status_format="#[fg=$color_light_gray,bg=default]#I: #(ba
|
|||||||
# tmux_conf_theme_window_status_current_format="#I #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}"
|
# tmux_conf_theme_window_status_current_format="#I #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}"
|
||||||
#tmux_conf_theme_window_status_current_format="#{circled_window_index} #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}"
|
#tmux_conf_theme_window_status_current_format="#{circled_window_index} #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}"
|
||||||
# tmux_conf_theme_window_status_current_format="#I: #(despell -e #W) #[fg=$tmux_conf_theme_window_status_current_fg]#W*#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,🔔,}#{?window_zoomed_flag,🔍,}"
|
# tmux_conf_theme_window_status_current_format="#I: #(despell -e #W) #[fg=$tmux_conf_theme_window_status_current_fg]#W*#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,🔔,}#{?window_zoomed_flag,🔍,}"
|
||||||
tmux_conf_theme_window_status_current_format="#[fg=$color_accent,bg=default,bold]#I: #(bash /Users/jsarthak/dotfiles/tmux/tmux-window-name.sh '#W' '#{pane_current_path}')#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,🔔,}#{?window_zoomed_flag,🔍,}"
|
tmux_conf_theme_window_status_current_format="#[fg=$color_accent,bg=default,bold]#I: #(bash $HOME/dotfiles/tmux/tmux-window-name.sh '#W' '#{pane_current_path}')#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,🔔,}#{?window_zoomed_flag,🔍,}"
|
||||||
|
|
||||||
tmux_conf_theme_window_status_current_fg="$window_status_current_fg"
|
tmux_conf_theme_window_status_current_fg="$window_status_current_fg"
|
||||||
tmux_conf_theme_window_status_current_bg="$window_status_current_bg"
|
tmux_conf_theme_window_status_current_bg="$window_status_current_bg"
|
||||||
@@ -263,7 +263,7 @@ tmux_conf_theme_status_left_fg="default"
|
|||||||
tmux_conf_theme_status_left_bg="default"
|
tmux_conf_theme_status_left_bg="default"
|
||||||
tmux_conf_theme_status_left_attr="none"
|
tmux_conf_theme_status_left_attr="none"
|
||||||
|
|
||||||
tmux_conf_theme_status_right=" #{prefix}#{mouse}#{pairing}#{synchronized}#{?pane_in_mode,#{?selection_active,#[fg=$color_blue,bg=default,bold] VISUAL,#[fg=$color_green,bg=default,bold] NORMAL},} | #[fg=$color_fg,bg=default,none] #{?uptime_d,#{uptime_d}d,}#{?uptime_h,#{uptime_h}h,}#{?uptime_m,#{uptime_m}m,} #[fg=$color_gray]│ #[fg=$color_cyan,bg=default,bold] %d %b %H:%M #[fg=$color_gray]│ #[fg=$color_purple,bg=default,bold] #{username}#{root}@#{hostname}"
|
tmux_conf_theme_status_right=" #{prefix}#{mouse}#{pairing}#{synchronized}#{@mode_indicator} | #[fg=$color_fg,bg=default,none] #{?uptime_d,#{uptime_d}d,}#{?uptime_h,#{uptime_h}h,}#{?uptime_m,#{uptime_m}m,} #[fg=$color_gray]│ #[fg=$color_cyan,bg=default,bold] %d %b %H:%M #[fg=$color_gray]│ #[fg=$color_purple,bg=default,bold] #{username}#{root}@#{hostname}"
|
||||||
|
|
||||||
# status right style
|
# status right style
|
||||||
tmux_conf_theme_status_right_fg="$color_red,$color_fg"
|
tmux_conf_theme_status_right_fg="$color_red,$color_fg"
|
||||||
@@ -361,11 +361,34 @@ tmux_conf_urlscan_options="--compact --dedupe"
|
|||||||
# -- user customizations -------------------------------------------------------
|
# -- user customizations -------------------------------------------------------
|
||||||
|
|
||||||
# Source modular configurations
|
# Source modular configurations
|
||||||
source-file "/Users/jsarthak/dotfiles/tmux/config/settings.conf"
|
source-file "$HOME/dotfiles/tmux/config/settings.conf"
|
||||||
source-file "/Users/jsarthak/dotfiles/tmux/config/keybindings.conf"
|
source-file "$HOME/dotfiles/tmux/config/keybindings.conf"
|
||||||
|
|
||||||
setw -g window-status-separator " #[fg=#484848]• " #!important
|
setw -g window-status-separator " #[fg=#484848]• " #!important
|
||||||
|
|
||||||
|
# ── Auto-name sessions (emoji + codename) ─────────────────────────────────────
|
||||||
|
# Fires on every new session. Skips sessions the user explicitly named.
|
||||||
|
# Script lives in ~/dotfiles/scripts/tmux-session-name.sh
|
||||||
|
# set-hook -g session-created \
|
||||||
|
# 'run-shell "bash $HOME/dotfiles/scripts/tmux-session-name.sh \"#{session_name}\" \"#{session_id}\""'
|
||||||
|
|
||||||
|
# ── Mode indicator (always-on, Neovim-style) ──────────────────────────────────
|
||||||
|
# NORMAL = working in tmux (default, always visible)
|
||||||
|
# VISUAL = in copy-mode (prefix + Enter)
|
||||||
|
#
|
||||||
|
# #{@mode_indicator} is a window user-option set via pane-mode-changed hook.
|
||||||
|
# We use -F flag so #{pane_in_mode} is evaluated as a tmux format (1=in mode).
|
||||||
|
# This bypasses oh-my-tmux's awk pipeline which mangles inline #{?...} conditionals.
|
||||||
|
|
||||||
|
# Set NORMAL as the default on startup
|
||||||
|
set-window-option -g @mode_indicator "#[fg=#25be6a,bold] NORMAL "
|
||||||
|
|
||||||
|
# Switch between NORMAL and VISUAL whenever the pane mode changes
|
||||||
|
set-hook -g pane-mode-changed \
|
||||||
|
'if-shell -F "#{pane_in_mode}" \
|
||||||
|
"set-window-option -g @mode_indicator \"#[fg=#78a9ff,bold] VISUAL \"" \
|
||||||
|
"set-window-option -g @mode_indicator \"#[fg=#25be6a,bold] NORMAL \""'
|
||||||
|
|
||||||
# ── Per-machine local override (untracked) ────────────────────────────────────
|
# ── Per-machine local override (untracked) ────────────────────────────────────
|
||||||
# Create ~/.tmux.conf.machine.local on each machine for host-specific tweaks
|
# Create ~/.tmux.conf.machine.local on each machine for host-specific tweaks
|
||||||
# (e.g. different color scheme, right-side content, etc.)
|
# (e.g. different color scheme, right-side content, etc.)
|
||||||
|
|||||||
Reference in New Issue
Block a user