From adcb6518d48ab41b26aeba77b3d0147d24dc287d Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Thu, 25 Jan 2024 00:16:30 -0500 Subject: Remove BLOCK_BUTTONS from dwmblocks --- .local/bin/dwmbar/dwmb-dotfiles | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) (limited to '.local/bin/dwmbar/dwmb-dotfiles') 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" -- cgit v1.2.3