#!/bin/dash # echo 0; exit 0 # loads colors . ~/.cache/wal/colors.sh SEPARATOR=" " # default color button 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 echo "" fi } # only show if content is not zero useif() { if [ -n "$2" ]; then use "$1" "$2" fi } # actual string echo "\ $(useif "󰇚" "$(updates read)")\ $(useif "󰍬" "$(mute shortstatus)")\ $(useif "󰕾" "$(volume)")\ $(useif "󰒢" "$(network)")\ $(use "󰘚" "$(load) | $(temp)")\ $(flash "󱐋" "$(ischarging)" "$(ischarging > /dev/null; echo $?)")\ $(use "󰃭" "$(datetime)")\ " # $(use "󱐋" "$(battery)")\