From a85519e1cb751f173c8533288c53523cb13594f9 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 14 Mar 2021 17:35:39 +0100 Subject: [PATCH] tmux: Use entr for dot session monitoring Since I always have entr installed, I can use it to monitor for file changes and reload the respective git overview panes. This has the advantage that I can use any interactive displays (e.g. less) in the respective panes, while still reloading when files actually change. I still have to find a way to replicate the switch between git log and staged changes view whenever files become staged, have not been able to fix this with entr and it still makes use of the watch command. --- tmux/.config/tmux/sessions/dot.session | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tmux/.config/tmux/sessions/dot.session b/tmux/.config/tmux/sessions/dot.session index 210d813..b268f5b 100644 --- a/tmux/.config/tmux/sessions/dot.session +++ b/tmux/.config/tmux/sessions/dot.session @@ -1,12 +1,13 @@ rename-window dot-git -send-keys "cd ~/.dotfiles; watch -t -n 1 -c 'git -c color.ui=always diff | tail -n $(($LINES - 2))'" C-m -split-window -h watch -t -n 1 -c 'cd ~/.dotfiles; git -c color.ui=always status | sed "s/\x1b\[m/\x1b\[00m/"' +send-keys "cd ~/.dotfiles; fd -t f --hidden | entr -c git -c color.ui=always diff" C-m +split-window -h "cd ~/.dotfiles; fd -t f --hidden | entr -c git -c color.ui=always status" split-window -v send-keys "cd ~/.dotfiles; clear" C-m L C-m select-pane -t 1 split-window -v watch -t -n 1 -c 'cd ~/.dotfiles; [ $(git diff --staged | wc -l) -eq 0 ] && git -c color.ui=always log --graph --date=short --decorate --oneline --all --remotes || git -c color.ui=always diff --staged | tail -n $(($LINES - 2))' select-pane -t 4 new-window -n code -send-keys "cd ~/.dotfiles; v ." C-m I +send-keys "cd ~/.dotfiles; v ." C-m zo new-window -n test select-window -t 1 +attach-session -t . -c ~/.dotfiles