adi1090x / polybar-themes

A huge collection of polybar themes with different styles, colors and variants.
GNU General Public License v3.0
5.59k stars 406 forks source link

color-switch.sh only changing one polybar instead of two on multiple display #160

Open narindraditantyo opened 2 years ago

narindraditantyo commented 2 years ago

I already customized my launch.sh both on ~/.config/polybar and ~/.config/polybar/shades but still can't change polybar color simultaneously on each monitor (HDMI-1-0 and eDP1), it only change color on one polybar instead (on eDP1).

Here's my ~/.config/polybar/launch.sh

# Get connected HDMI-1-0 status
external_monitor_status=$(xrandr --query | grep 'HDMI-1-0')

# Launch the bar
if [[ "$style" == "hack" || "$style" == "cuts" ]]; then
        polybar -q top -c "$dir/$style/config.ini" &
        polybar -q bottom -c "$dir/$style/config.ini" &
elif [[ "$style" == "pwidgets" ]]; then
        bash "$dir"/pwidgets/launch.sh --main
else
        polybar -q main -c "$dir/$style/config.ini" &
        if [[ $external_monitor_status = *connected* ]]; then
                polybar -q main_external -c "$dir/$style/config.ini" &
        fi
fi

And here's my ~/.config/polybar/shades/launch.sh

# Get connected HDMI-1-0 status
external_monitor_status=$(xrandr --query | grep 'HDMI-1-0')

# Launch the bar
polybar -q main -c "$DIR"/config.ini &
if [[ $external_monitor_status = *connected* ]]; then
        polybar -q main_external -c "$DIR"/config.ini &
fi