diff options
author | Benjamin Chausse <benjamin@chausse.xyz> | 2024-01-25 00:16:30 -0500 |
---|---|---|
committer | Benjamin Chausse <benjamin@chausse.xyz> | 2024-01-25 00:16:30 -0500 |
commit | adcb6518d48ab41b26aeba77b3d0147d24dc287d (patch) | |
tree | 0ad7b3c40e7145360d3443c2238c89f31c431419 /.local/bin/dwmbar/dwmb-dotfiles | |
parent | 2a4848c8fdf131e92a4d66eff4f9d0f4f4081eaf (diff) |
Remove BLOCK_BUTTONS from dwmblocks
Diffstat (limited to '.local/bin/dwmbar/dwmb-dotfiles')
-rwxr-xr-x | .local/bin/dwmbar/dwmb-dotfiles | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/.local/bin/dwmbar/dwmb-dotfiles b/.local/bin/dwmbar/dwmb-dotfiles index aca2727..1138929 100755 --- a/.local/bin/dwmbar/dwmb-dotfiles +++ b/.local/bin/dwmbar/dwmb-dotfiles @@ -1,20 +1,32 @@ #!/bin/bash -dotfiles=$(yadm status | sed '1,3d; - 5,$d; - s/.$//g') +# Other icons that could be used: +# Git: +# Config: -if [[ ${dotfiles:0:1} == "n" ]]; then - warn="" -else - warn=" " -fi +# Dotfiles tracker for dwmblocks (using yadm) +# This block aims to never show up (to be out of sight, out of mind) +# If the following situation occurs, the following icons will be shown: +# +# - : There are uncommitted changes +# - : There are staged changes +# - : Unpushed changes +# - : Upstream has changes that are not pulled +# +# These icons will sit next the this block's base icon +# +# Only one icon will be shown at a time, and the order of priority is: +# uncommitted > staged > unpushed > upstream +status=$(yadm status --porcelain 2>/dev/null) +[ -z "$status" ] && exit 0 -echo " $warn " -case $BLOCK_BUTTON in - 1) $TERMINAL -c dropdown -e yadm diff ;; - 3) $TERMINAL -c dropdown -e dfup ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; +case "$status" in +*M*) icon=" " ;; +*A*) icon=" " ;; +*U*) icon=" " ;; +*D*) icon=" " ;; esac + +printf " %s" "$icon" |