From cdd4082fb8fef8a53b48e9eb41ac7994574dfd02 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sat, 27 Feb 2021 13:33:26 -0700 Subject: [PATCH] maint: tmux status checks --- check_status.sh | 21 +++++++++++++++++++++ git/gitconfig | 5 +++++ tmux.conf | 2 +- vscode/settings.json | 3 ++- 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100755 check_status.sh diff --git a/check_status.sh b/check_status.sh new file mode 100755 index 0000000..348fa41 --- /dev/null +++ b/check_status.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env zsh + +local a="main" b="pingo/main" +local base=$( git merge-base $a $b ) +local aref=$( git rev-parse $a ) +local bref=$( git rev-parse $b ) + +if [[ $(git diff --stat) != '' ]]; then + echo 'dotfiles: dirty' + exit +fi + +if [[ $aref == "$bref" ]]; then + echo '' +elif [[ $aref == "$base" ]]; then + echo 'dotfiles: needs a pull' +elif [[ $bref == "$base" ]]; then + echo 'dotfiles: needs a push' +else + echo 'dotfiles diverged' +fi diff --git a/git/gitconfig b/git/gitconfig index eadcfe2..5b45310 100644 --- a/git/gitconfig +++ b/git/gitconfig @@ -56,3 +56,8 @@ rebase = true [init] defaultBranch = main +[filter "lfs"] + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + process = git-lfs filter-process + required = true diff --git a/tmux.conf b/tmux.conf index 0e88e4a..b190548 100644 --- a/tmux.conf +++ b/tmux.conf @@ -29,7 +29,7 @@ set -g status-justify centre set -g status-left-length 50 set -g status-right-length 140 set -g status-left '#[fg=green]#H#[default] session:#S' -set -g status-right '#[fg=white,bg=default]%a %l:%M:%S %p#[default] #[fg=blue]%Y-%m-%d' +set -g status-right '#[fg=black,bg=colour119]#(cd ~/.password-store && ./check_status.sh)#[default] #[fg=black,bg=colour215]#(cd ~/.dotfiles && ./check_status.sh)#[default] #[fg=white,bg=default]%a %l:%M:%S %p#[default] #[fg=blue]%Y-%m-%d' set-option -g renumber-windows on set -sg escape-time 0 diff --git a/vscode/settings.json b/vscode/settings.json index 4e64c52..825084e 100644 --- a/vscode/settings.json +++ b/vscode/settings.json @@ -26,5 +26,6 @@ "python.defaultInterpreterPath": "~/.conda/envs/q2dev/bin/python", "python.terminal.activateEnvInCurrentTerminal": true, "python.languageServer": "Microsoft", - "git.enabled": false + "git.enabled": false, + "liveshare.authenticationProvider": "GitHub" }