From 179f23b63382abd24c9142d6523cfc78eea899c0 Mon Sep 17 00:00:00 2001 From: Gal Szkolnik Date: Sat, 4 Jun 2022 15:31:20 -0400 Subject: [PATCH] Added cz-add-changes + cleanedup poshtheme = Oh-My-Posh theme template change to not( continas ...) logic instead of an empty condition and an {{ else }}. + cz-add-changes will add any changes made to chezmoi --- _home/dot_sz.shrc.d/97_chezmoi_aliases | 10 ++++++++++ _home/private_dot_poshtheme.omp.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/_home/dot_sz.shrc.d/97_chezmoi_aliases b/_home/dot_sz.shrc.d/97_chezmoi_aliases index 8828eb1..694df4e 100644 --- a/_home/dot_sz.shrc.d/97_chezmoi_aliases +++ b/_home/dot_sz.shrc.d/97_chezmoi_aliases @@ -3,6 +3,16 @@ if [[ -n "$(type -fP chezmoi)" ]]; then alias cz-refresh="chezmoi status | cut -d\ -f2 | grep '^\.sz\.shrc\.d' | xargs chezmoi forget --force; chezmoi add ~/.sz.shrc.d --recursive; chezmoi status; chezmoi git status" alias cz-commit="chezmoi git -- commit -a " + function cz-add-changes() { + pushd ~ > /dev/null + changes=$(chezmoi status | sed -n 's/^MM[ \t]\+//p') + for c in $changes; do + echo Adding $c + chezmoi add $c + done + popd > /dev/null + } + function cz-set-ssh-github() { chezmoi git -- remote set-url origin "$(chezmoi git -- remote get-url origin | sed 's|https://github.com/|git@github.com:|')" chezmoi git -- remote get-url origin diff --git a/_home/private_dot_poshtheme.omp.json b/_home/private_dot_poshtheme.omp.json index baf2025..dc282a9 100644 --- a/_home/private_dot_poshtheme.omp.json +++ b/_home/private_dot_poshtheme.omp.json @@ -25,7 +25,7 @@ "shell": "bash", "command": "systemctl is-system-running || true" }, - "template": "{{ if contains \"running\" .Output }}{{ else }} {{ .Output }} {{ end }}" + "template": "{{ if not (contains \"running\" .Output) }} {{ .Output }} {{ end }}" }, { "background": "#3465a4",