Files
nixos/modules/tmux.nix
2025-09-16 15:02:56 -04:00

127 lines
4.0 KiB
Nix

{ pkgs, config, ... }:
{
programs.tmux = {
enable = true;
baseIndex = 1;
clock24 = true;
disableConfirmationPrompt = true;
keyMode = "vi";
mouse = true;
newSession = true;
plugins = with pkgs; [
# tmuxPlugins.cpu
{
plugin = tmuxPlugins.resurrect;
extraConfig = "set -g @resurrect-strategy-nvim 'session'";
}
{
plugin = tmuxPlugins.continuum;
extraConfig = ''
set -g @continuum-restore 'on'
set -g @continuum-save-interval '60'
'';
}
tmuxPlugins.yank
tmuxPlugins.vim-tmux-navigator
tmuxPlugins.vim-tmux-focus-events
tmuxPlugins.urlview
tmuxPlugins.tmux-fzf
tmuxPlugins.sidebar
{
plugin = tmuxPlugins.tokyo-night-tmux;
extraConfig = ''
set -g @tokyo-night-tmux_window_id_style digital
set -g @tokyo-night-tmux_pane_id_style hsquare
set -g @tokyo-night-tmux_zoom_id_style dsquare
set -g @tokyo-night-tmux_show_path 1
set -g @tokyo-night-tmux_path_format relative # 'relative' or 'full'
set -g @tokyo-night-tmux_show_git 0
if-shell "[[ $(hostname) = 'xps13' ]]" {
# set -g @tokyo-night-tmux_show_netspeed 1
set -g @tokyo-night-tmux_netspeed_iface 'wlp2s0'
set -g @tokyo-night-tmux_netspeed_showip 1
# set -g @tokyo-night-tmux_netspeed_refresh 1
set -g @tokyo-night-tmux_show_battery_widget 1
set -g @tokyo-night-tmux_battery_name "BAT0"
set -g @tokyo-night-tmux_battery_low_threshold 21
}
'';
}
{
plugin = tmuxPlugins.pass;
extraConfig = ''
set -g @pass-key b
set -g @pass-copy-to-clipboard on
'';
}
# {
# plugin = tmuxPlugins.tilish;
# extraConfig = ''
# set -g @tilish-navigator 'on'
# set -g @tilish-default 'main-vertical'
# set -g @tilish-enforce 'none'
# set -g escape-time 0
# set -g @tilish-dmenu 'on'
# '';
# }
];
prefix = "C-a";
shell = "${pkgs.zsh}/bin/zsh";
# terminal = "xterm-kitty:RGB";
tmuxinator.enable = true;
extraConfig = ''
if-shell "[[ $(hostname) = 'xps13' ]]" {
set-option -as terminal-features 'foot:RGB'
}
if-shell "[[ $(hostname) = 'Titan' ]]" {
# set-option -as terminal-features 'xterm-256color:RGB'
# set -g default-terminal "tmux-256color"
# set -g terminal-overrides ",xterm-256color:RGB"
set -g default-terminal "tmux-256color"
# Enable 24-bit color for ANY parent terminal tmux detects
# (covers foot, kitty, wezterm, alacritty, xterm-256color, etc.)
set-option -as terminal-features '*:RGB'
# If you previously set terminal-overrides/Tc, drop them to avoid conflicts
# set -gu terminal-overrides # uncomment if you had overrides before
}
if-shell "[[ $(hostname) = 'Athena' ]]" {
# set-option -as terminal-features 'xterm-256color:RGB'
# set -g default-terminal "tmux-256color"
# set -g terminal-overrides ",xterm-256color:RGB"
set -g default-terminal "tmux-256color"
# Enable 24-bit color for ANY parent terminal tmux detects
# (covers foot, kitty, wezterm, alacritty, xterm-256color, etc.)
set-option -as terminal-features '*:RGB'
# If you previously set terminal-overrides/Tc, drop them to avoid conflicts
# set -gu terminal-overrides # uncomment if you had overrides before
}
set-option -g update-environment "DISPLAY XAUTHORITY WAYLAND_DISPLAY XDG_RUNTIME_DIR HYPRLAND_INSTANCE_SIGNATURE"
set -g focus-events on
set -g escape-time 3
set-option -g status-position top
set -g default-terminal 'tmux-256color'
bind-key b choose-tree -Z "run-shell 'tmux swap-pane -s %%'"
bind C-p run-shell 'tmuxsessions.sh'
bind C-d run-shell 'dotfile-picker.sh'
bind [ run-shell 'project-picker.sh'
bind C-c display-popup -E -w 60% -h 60% "pytui -n"
bind m display-popup -E -w 60% -h 60% "pytui -m"
bind C-o display-popup -E -w 50% -h 50% 'igrep ~/wiki/notes'
bind j run-shell 'popuptmux'
bind r source-file ~/.config/tmux/tmux.conf \; display "Reloaded!"
bind-key -n F4 split-window -v 'ranger $PWD'
bind-key -n C-f split-window 'ranger .'
bind C-i split-window -v 'igrep .'
'';
};
}