aboutsummaryrefslogtreecommitdiff
path: root/scripts/.local/bin/personal/bar/status
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/.local/bin/personal/bar/status')
-rwxr-xr-xscripts/.local/bin/personal/bar/status19
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)")\