Compare commits

..

1 Commits

Author SHA1 Message Date
jsarthak c08e57e256 Fix bash fzf 2026-07-18 15:29:04 +05:30
6 changed files with 11 additions and 91 deletions
-54
View File
@@ -1,54 +0,0 @@
#!/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
-3
View File
@@ -5,9 +5,6 @@
export EDITOR='nvim'
export VISUAL='nvim'
# Dotfiles root — used by scripts and tmux hooks
export DOTFILES="$HOME/dotfiles"
# Man page rendering
export MANROFFOPT="-c"
+1
View File
@@ -15,6 +15,7 @@ fi
eval "$(fzf --bash)"
[[ -f ~/.fzf.zsh ]] && source ~/.fzf.zsh
# Zoxide (smarter cd) — in case not already initialized by bashrc
if [[ -n "$ZSH_VERSION" ]]; then
command -v zoxide >/dev/null && eval "$(zoxide init zsh)"
-1
View File
@@ -10,7 +10,6 @@ export PATH="/Users/jsarthak/.antigravity/antigravity/bin:$PATH"
# Flutter SDK
export PATH="/Users/jsarthak/flutter-sdk/flutter/bin:$PATH"
export PATH="/Users/jsarthak/.local/bin:$PATH"
# fzf shell integration (macOS path)
source <(fzf --zsh) 2>/dev/null || true
+2 -2
View File
@@ -1,7 +1,7 @@
# starship.toml - Fully riced modern prompt config aligned with Carbonfox theme
format = """
$os$username$hostname$directory$git_branch$git_state$git_status$cmd_duration$line_break\
$os$username$hostname$directory$git_branch$git_state$git_status$python$nodejs$rust$golang$cmd_duration$line_break\
$character"""
# Wait 10 milliseconds for starship to check files under the current directory.
@@ -88,7 +88,7 @@ format = "via [$symbol$version]($style) "
[cmd_duration]
min_time = 100
style = "bold yellow"
format = "took [$duration]($style) "
format = "underwent [$duration]($style) "
[status]
style = "bg:blue"
+5 -28
View File
@@ -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="#{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="#[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,🔍,}"
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,🔍,}"
# window current status style
# - 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="#{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="#[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_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_fg="$window_status_current_fg"
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_attr="none"
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}"
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}"
# status right style
tmux_conf_theme_status_right_fg="$color_red,$color_fg"
@@ -361,34 +361,11 @@ tmux_conf_urlscan_options="--compact --dedupe"
# -- user customizations -------------------------------------------------------
# Source modular configurations
source-file "$HOME/dotfiles/tmux/config/settings.conf"
source-file "$HOME/dotfiles/tmux/config/keybindings.conf"
source-file "/Users/jsarthak/dotfiles/tmux/config/settings.conf"
source-file "/Users/jsarthak/dotfiles/tmux/config/keybindings.conf"
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) ────────────────────────────────────
# Create ~/.tmux.conf.machine.local on each machine for host-specific tweaks
# (e.g. different color scheme, right-side content, etc.)