UtkarshVerma / dwmblocks-async

An efficient, lean, and asynchronous status feed generator for dwm.
GNU General Public License v2.0
224 stars 87 forks source link

dwmblocks status2d background #19

Closed twoeightdev closed 2 years ago

twoeightdev commented 2 years ago

hi sir, it's been 2months since i use your dwmblocks-async and it's doing great. im also using your script that sets foreground color with status2d. im planning to also set a background for module just use your sb-theme script. how to extend your script to also set a background color inside your script sb-theme to have something like echo $args "^c$color^$1^b$color^" thank you sir.

#!/bin/sh

# Gruvbox colorscheme
color0="#5d6061"    # gray
color1="#32302f"    # black
color2="#ea6962"    # red
color3="#a9b665"    # green
color4="#e78a4e"    # yellow
color5="#7daea3"    # blue
color6="#d3869b"    # magenta
color7="#89b482"    # cyan
color8="#d4be98"    # white

display() {
    args=""
    case $1 in
        -n) args="-n"; shift ;;
    esac

    if [ -n "${2+x}" ]; then
        color=$2
    else
        case "$(basename $0)" in
            sb-torrent) color="$color8" ;;
            sb-net) color="$color6" ;;
            sb-xbps) color="$color5" ;;
            sb-audio) color="$color4" ;;
            sb-mail) color="$color3" ;;
            sb-news) color="$color2" ;;
            sb-forecast) color="$color7" ;;
            sb-mem) color="$color3" ;;
            sb-gpu) color="$color4" ;;
            sb-cpu) color="$color3" ;;
            #sb-time) color="$color4" ;;
            sb-date) color="$color2" ;;
            sb-uptime) color="$color0" ;;
            *) color="$color8" ;;
        esac
    fi
    echo $args "^c$color^$1"
}
UtkarshVerma commented 2 years ago

You have to modify the echo command in the end according to status2d syntax.

https://dwm.suckless.org/patches/status2d/

UtkarshVerma commented 2 years ago

Closing due to inactivity.