Add sshfs, tmuxKiller; Update

This commit is contained in:
Martin Pander
2026-06-19 07:09:36 +02:00
parent 4343c4b7ee
commit 1e0bc5d2b8
4 changed files with 49 additions and 13 deletions

View File

@@ -72,6 +72,34 @@ let
fi
done
'';
tmuxKiller = pkgs.writeScriptBin "tmuxKiller" ''
#!${pkgs.zsh}/bin/zsh
# 1. Build the list of active tmux sessions
sessions=$(${pkgs.tmux}/bin/tmux list-sessions -F "#S" 2>/dev/null)
if [[ -z "$sessions" ]]; then
echo "No active tmux sessions found."
exit 0
fi
# 2. Open fzf (Multi-select: Tab to mark multiple, Enter to confirm)
selected=$(echo "$sessions" | ${pkgs.fzf}/bin/fzf -m --header="Select tmux sessions to KILL (Tab to multi-select)" --reverse)
[[ -z "$selected" ]] && exit 0
# 3. Process selections
# Convert newline-separated string to array
selected_array=("''${(@f)selected}")
for s_name in "''${selected_array[@]}"; do
if ${pkgs.tmux}/bin/tmux has-session -t "$s_name" 2>/dev/null; then
${pkgs.tmux}/bin/tmux kill-session -t "$s_name"
echo "Killed session: $s_name"
fi
done
'';
in
{
options.dot.tmux = {
@@ -110,6 +138,8 @@ in
bind C-g display-popup -E -d "#{pane_current_path}" -xC -yC -w 95% -h 95% "lazygit"
bind C-t display-popup -E -xC -yC -w 95% -h 95% "tasksquire"
bind C-r display-popup -E "tmuxKiller"
${lib.optionalString cfg.workMode ''
bind C-s display-popup -E "projectSelector"
bind C-n display-popup -E -xC -yC -w 95% -h 95% -d "/mnt/c/Users/marti/Documents/notes/Work/" "vim quick_notes.md"
@@ -236,7 +266,9 @@ in
compdef _pro_completion pro
'';
home.packages = lib.optional cfg.workMode projectSelector;
home.packages = [
tmuxKiller
] ++ lib.optional cfg.workMode projectSelector;
home.shellAliases = {
"o" = "tmuxp";