From be336551e3b180cfbd193501ac574c160f0db7d6 Mon Sep 17 00:00:00 2001 From: punkfairie <23287005+punkfairie@users.noreply.github.com> Date: Mon, 5 Feb 2024 18:10:41 -0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Create=20popups=20in=20tmux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- os/com.googlecode.iterm2.plist | 33 +++++++++++++++++++++++++++++++++ tmux/.tmux.conf.hardlink | 15 +++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/os/com.googlecode.iterm2.plist b/os/com.googlecode.iterm2.plist index 02299c8..0101cd7 100644 --- a/os/com.googlecode.iterm2.plist +++ b/os/com.googlecode.iterm2.plist @@ -2973,6 +2973,17 @@ Version 1 + 0x49-0x120000-0x22 + + Action + 11 + Label + + Text + 0x01 0x49 + Version + 1 + 0x68-0x100000-0x4 Action @@ -3006,6 +3017,17 @@ Version 1 + 0x69-0x100000-0x22 + + Action + 11 + Label + + Text + 0x01 0x69 + Version + 1 + 0x6a-0x100000-0x26 Action @@ -3083,6 +3105,17 @@ Version 1 + 0x72-0x100000-0xf + + Action + 11 + Label + + Text + 0x01 0x72 + Version + 1 + 0x78-0x100000-0x7 Action diff --git a/tmux/.tmux.conf.hardlink b/tmux/.tmux.conf.hardlink index a813fec..7edba27 100644 --- a/tmux/.tmux.conf.hardlink +++ b/tmux/.tmux.conf.hardlink @@ -17,6 +17,9 @@ set -g base-index 1 # Make pane index start at 1. setw -g pane-base-index 1 +# Automatically renumber windows when one is deleted. +set -g renumber-windows on + set -g default-terminal "screen-256color" ################################################################################ @@ -52,6 +55,18 @@ bind l resize-pane -R # cmd-l in iTerm2 # Easy reload config. bind r source-file ~/.tmux.conf +# Popup. +unbind i +bind i if-shell -F '#{==:#{session_name},scratch}' { # cmd-i in iTerm2 + detach-client + } { + if-shell "tmux has-session -t scratch" { + display-popup -E -h 90% -w 90% "tmux attach-session -t scratch" + } { + display-popup -E -h 90% -w 90% "tmux new-session -d -c '#{pane_current_path}' -s scratch && tmux set-option -t scratch status off && tmux attach-session -t scratch" + } +} + ################################################################################ # Catppuccin # ################################################################################