From 5d630d77ca8ae32a83d182628d21535dd73b8ae8 Mon Sep 17 00:00:00 2001 From: Crony Akatsuki Date: Mon, 10 Feb 2025 22:51:28 +0100 Subject: [PATCH] Bring back sesh, it's just that good. --- modules/home-manager/tmux.nix | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/modules/home-manager/tmux.nix b/modules/home-manager/tmux.nix index 7ed01be..b3c25b1 100644 --- a/modules/home-manager/tmux.nix +++ b/modules/home-manager/tmux.nix @@ -1,6 +1,5 @@ { config, - inputs, pkgs, lib, ... @@ -15,6 +14,11 @@ TINTED_TMUX_OPTION_STATUSBAR = 1; }; + + home.packages = with pkgs; [ + sesh + ]; + # Setup tmux programs.tmux = { enable = true; @@ -57,6 +61,24 @@ # Bar to top set-option -g status-position top + + # Sesh section + bind-key "T" run-shell "sesh connect \"$( + sesh list --icons | fzf-tmux -p 80%,70% \ + --no-sort --ansi --border-label ' sesh ' --prompt '⚡ ' \ + --header ' ^a all ^t tmux ^g configs ^x zoxide ^d tmux kill ^f find' \ + --bind 'tab:down,btab:up' \ + --bind 'ctrl-a:change-prompt(⚡ )+reload(sesh list --icons)' \ + --bind 'ctrl-t:change-prompt(🪟 )+reload(sesh list -t --icons)' \ + --bind 'ctrl-g:change-prompt(⚙️ )+reload(sesh list -c --icons)' \ + --bind 'ctrl-x:change-prompt(📁 )+reload(sesh list -z --icons)' \ + --bind 'ctrl-f:change-prompt(🔎 )+reload(fd -H -d 2 -t d -E .Trash . ~)' \ + --bind 'ctrl-d:execute(tmux kill-session -t {2..})+change-prompt(⚡ )+reload(sesh list --icons)' \ + --preview-window 'right:55%' \ + --preview 'sesh preview {}' + )\"" + + bind -N "last-session (via sesh) " L run-shell "sesh last" ''; plugins = with pkgs.tmuxPlugins; [