grace/dots

dotfiles/nix configs

git clone https://git.gae.moe/grace/dots

Grace Yoderi gotta stop doing these massive changesb70d9f9

main
2.6 KiB74 linesraw
1{ pkgs, ... }:
2
3let
4  seshPicker = pkgs.writeShellScript "sesh-picker" ''
5    export PATH=${pkgs.lib.makeBinPath [ pkgs.sesh pkgs.fzf pkgs.tmux pkgs.zoxide pkgs.fd ]}:"$PATH"
6    selection=$(sesh list --icons | fzf-tmux -p 80%,70% \
7      --no-sort --ansi --border-label ' sesh ' --prompt '⚡  ' \
8      --header '  ^a all ^t tmux ^g configs ^x zoxide ^d tmux kill ^f find' \
9      --bind 'tab:down,btab:up' \
10      --bind 'ctrl-a:change-prompt(⚡  )+reload(sesh list --icons)' \
11      --bind 'ctrl-t:change-prompt(🪟  )+reload(sesh list -t --icons)' \
12      --bind 'ctrl-g:change-prompt(⚙️  )+reload(sesh list -c --icons)' \
13      --bind 'ctrl-x:change-prompt(📁  )+reload(sesh list -z --icons)' \
14      --bind 'ctrl-f:change-prompt(🔎  )+reload(fd -H -d 2 -t d -E .Trash . ~)' \
15      --bind 'ctrl-d:execute(tmux kill-session -t {2..})+change-prompt(⚡  )+reload(sesh list --icons)' \
16      --preview-window 'right:55%' \
17      --preview 'sesh preview {}') || exit 0
18    [ -n "$selection" ] || exit 0
19    sesh connect "$selection"
20  '';
21in
22{
23  programs.tmux = {
24    enable = true;
25    mouse = true;
26    keyMode = "vi";
27    baseIndex = 1;
28    prefix = "C-b";
29    terminal = "xterm-ghostty";
30    plugins = with pkgs.tmuxPlugins; [
31      sensible
32      yank
33      resurrect
34      continuum
35      {
36        plugin = rose-pine;
37        extraConfig = ''
38          set -g @rose_pine_variant 'main'
39          set -g @rose_pine_left_separator ' > '
40          set -g @rose_pine_right_separator '  '
41          set -g @rose_pine_field_separator ' | '
42          set -g @rose_pine_window_separator ':'
43          set -g @rose_pine_window_status_separator '  '
44        '';
45      }
46    ];
47    extraConfig = ''
48      set -g status-position top
49      set -s set-clipboard on
50      set -s get-clipboard both
51      set -g set-titles on
52      set -g set-titles-string "#{session_name}"
53      setw -g pane-base-index 1
54      set -g allow-passthrough all
55      set -as terminal-features ",xterm-ghostty:hyperlinks"
56      set -ga terminal-overrides ",xterm-ghostty:Tc"
57
58      unbind C-b
59      set -g prefix C-\\
60      bind -N "Send the prefix key through to the application" C-\\ send-prefix
61      bind -N "Refresh system clipboard via OSC 52" Y refresh-client -l
62      bind -N "Pick a sesh session" T run-shell "${seshPicker}"
63
64      bind v split-window -h -c "#{pane_current_path}"
65      bind b split-window -v -c "#{pane_current_path}"
66      bind c new-window -c "#{pane_current_path}"
67      bind -n M-h select-pane -L
68      bind -n M-j select-pane -D
69      bind -n M-k select-pane -U
70      bind -n M-l select-pane -R
71    '';
72  };
73
74}