diff options
author | davidpkj <davidpenkow1@gmail.com> | 2024-04-17 18:35:12 +0200 |
---|---|---|
committer | davidpkj <davidpenkow1@gmail.com> | 2024-04-17 18:35:12 +0200 |
commit | 15b131da12cf4975307d4f7618a1f2902a1a9dc9 (patch) | |
tree | daf6cfab9bcfb3b79840fede465b585432537926 /scripts/.local/bin/personal/bar/status | |
parent | 5b9f5d92c4b6961049179598a235db60bed6ecbf (diff) |
potato update
Diffstat (limited to 'scripts/.local/bin/personal/bar/status')
-rwxr-xr-x | scripts/.local/bin/personal/bar/status | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/scripts/.local/bin/personal/bar/status b/scripts/.local/bin/personal/bar/status index da46bf0..661b60f 100755 --- a/scripts/.local/bin/personal/bar/status +++ b/scripts/.local/bin/personal/bar/status @@ -12,12 +12,26 @@ use() { printf "%s^c%s^^b%s^ %s ^b%s^ %s ^b%s^" "$SEPARATOR" "$background" "$primary" "$1" "$accent" "$2" "$background" } +flash() { + second="$(date +'%s')" + + if [ "$3" = "1" ]; then + if [ $((second % 2)) = 1 ]; then + printf "%s^c%s^^b%s^ %s ^c%s^^b%s^ %s ^b%s^" "$SEPARATOR" "$color1" "$background" "$1" "$color1" "$background" "$2" "$background" + else + printf "%s^c%s^^b%s^ %s ^c%s^^b%s^ %s ^b%s^" "$SEPARATOR" "$background" "$color1" "$1" "$background" "$color1" "$2" "$background" + fi + else + echo "" + fi +} + # show in specified color if specified condition is true usecolorif() { if [ "$3" = "1" ]; then printf "%s^c%s^^b%s^ %s ^c%s^^b%s^ %s ^b%s^" "$SEPARATOR" "$primary" "$background" "$1" "$accent" "$background" "$2" "$background" else - use "$1" "$2" + echo "" fi } @@ -35,6 +49,7 @@ $(useif "" "$(mute shortstatus)")\ $(useif "" "$(volume)")\ $(useif "" "$(network)")\ $(use "" "$(load) | $(temp)")\ -$(use "" "$(battery)")\ +$(flash "" "$(ischarging)" "$(ischarging > /dev/null; echo $?)")\ $(use "" "$(datetime)")\ " +# $(use "" "$(battery)")\ |