From 0acbb7fca2a922d6ee14409b5cedb2b84e60d538 Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Wed, 30 Jul 2025 23:31:58 +0200 Subject: [PATCH] Simplify activity monitoring by disabling it in lazygit project templates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace complex tmux hooks with targeted solution: - Disable activity monitoring in basic.sh for git window (lazygit) - Disable activity monitoring in research.sh for both code-git and paper-git windows - Remove unreliable program detection hooks from tmux config - Keep manual toggle (Ctrl+a A) for user control This approach is simpler, more reliable, and directly addresses the root cause of noisy activity notifications from project templates. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- modules/tmux.nix | 19 ------------------- scripts/templates/basic.sh | 1 + scripts/templates/research.sh | 2 ++ 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/modules/tmux.nix b/modules/tmux.nix index 2ba89eb..48aedb6 100644 --- a/modules/tmux.nix +++ b/modules/tmux.nix @@ -97,25 +97,6 @@ setw -g monitor-activity on set -g visual-activity off - # Smart activity monitoring - disable for noisy programs - set-hook -g after-new-window { - if -F '#{||:#{||:#{||:#{||:#{==:#{pane_current_command},lazygit},#{==:#{pane_current_command},btop}},#{==:#{pane_current_command},htop}},#{==:#{pane_current_command},watch}},#{==:#{pane_current_command},tail}}' { - setw monitor-activity off - } - } - - set-hook -g window-pane-changed { - if -F '#{||:#{||:#{||:#{||:#{==:#{pane_current_command},lazygit},#{==:#{pane_current_command},btop}},#{==:#{pane_current_command},htop}},#{==:#{pane_current_command},watch}},#{==:#{pane_current_command},tail}}' { - setw monitor-activity off - } { - setw monitor-activity on - } - } - - set-hook -g pane-exited { - setw monitor-activity on - } - # Manual toggle for activity monitoring bind A setw monitor-activity \; display-message "Activity monitoring: #{?monitor-activity,ON,OFF}" diff --git a/scripts/templates/basic.sh b/scripts/templates/basic.sh index b245032..2f6f3eb 100755 --- a/scripts/templates/basic.sh +++ b/scripts/templates/basic.sh @@ -26,6 +26,7 @@ tmux split-window -t $SESSION_NAME:2.2 -v -c "$CODE_PATH" tmux select-pane -t $SESSION_NAME:2.1 tmux new-window -t $SESSION_NAME:3 -n "git" -c "$CODE_PATH" tmux send-keys -t $SESSION_NAME:3 "lazygit" C-m +tmux setw -t $SESSION_NAME:3 monitor-activity off tmux new-window -t $SESSION_NAME:4 -n "shell" -c "$CODE_PATH" tmux select-window -t $SESSION_NAME:1 diff --git a/scripts/templates/research.sh b/scripts/templates/research.sh index c8ed1df..ac2812b 100755 --- a/scripts/templates/research.sh +++ b/scripts/templates/research.sh @@ -31,6 +31,7 @@ tmux split-window -t $SESSION_NAME:2.2 -v -c "$CODE_PATH" tmux select-pane -t $SESSION_NAME:2.1 tmux new-window -t $SESSION_NAME:3 -n "code-git" -c "$CODE_PATH" tmux send-keys -t $SESSION_NAME:3 "lazygit" C-m +tmux setw -t $SESSION_NAME:3 monitor-activity off # Create windows for paper tmux new-window -t $SESSION_NAME:4 -n "paper" -c "$PAPER_PATH" @@ -45,6 +46,7 @@ tmux split-window -t $SESSION_NAME:5.2 -v -c "$PAPER_PATH" tmux select-pane -t $SESSION_NAME:5.1 tmux new-window -t $SESSION_NAME:6 -n "paper-git" -c "$PAPER_PATH" tmux send-keys -t $SESSION_NAME:6 "lazygit" C-m +tmux setw -t $SESSION_NAME:6 monitor-activity off # Create remote server window if server details are provided if [ -n "$SERVER" ] && [ -n "$REMOTE_DIR" ]; then