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.
This commit is contained in:
parent
08c6aee17e
commit
a85519e1cb
1 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue