Skip to content

Commit 31ae52e

Browse files
committed
feat(ghostty): launch tmux by default via command config
Set Ghostty to use the tmux wrapper as its default command, simplify the Niri terminal binding to launch Ghostty directly, and update the wrapper to attach or create sessions based on active tmux clients.
1 parent 1bb0864 commit 31ae52e

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

dot_config/ghostty/config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,6 @@ theme = dankcolors
5858

5959
# Shader
6060
custom-shader = shaders/cursor_warp.glsl
61+
62+
# Command
63+
command = $HOME/.local/bin/ghostty-tmux.sh

dot_config/niri/dms/binds.kdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ binds {
1212
Mod+M hotkey-overlay-title="Music Player" { spawn "/opt/SPlayer/SPlayer"; }
1313
Mod+N hotkey-overlay-title="Notification Center" { spawn "dms" "ipc" "call" "notifications" "toggle"; }
1414
Mod+S hotkey-overlay-title="Code Editor" { spawn "code"; }
15-
Mod+T hotkey-overlay-title="Open Terminal" { spawn "sh" "-c" "$HOME/.local/bin/ghostty-tmux.sh"; }
15+
Mod+T hotkey-overlay-title="Open Terminal" { spawn "ghostty"; }
1616
Mod+X hotkey-overlay-title="Power Menu: Toggle" { spawn "dms" "ipc" "call" "powermenu" "toggle"; }
1717
Mod+Y hotkey-overlay-title="Browse Wallpapers" { spawn "dms" "ipc" "call" "dankdash" "wallpaper"; }
1818
Mod+Shift+C hotkey-overlay-title="Clipboard Manager" { spawn "dms" "ipc" "call" "clipboard" "toggle"; }
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

3-
if pgrep -x "ghostty" >/dev/null; then
4-
ghostty -e sh -c "tmux new-session \; set-option destroy-unattached on" &
3+
if tmux list-clients -F '#{client_pid}' 2>/dev/null | grep -q .; then
4+
tmux new-session \; set-option destroy-unattached on
55
else
6-
ghostty -e sh -c "tmux attach || tmux" &
6+
tmux attach-session || tmux new-session
77
fi

0 commit comments

Comments
 (0)