#!/bin/sh
killall waybar
WC="$(crcparse WC)"
CALLED="${1:-$WC}"
if type "wlr-randr"; then
for m in $(wlr-randr | grep -B5 'Enabled: yes' | sed '/^\s\s*/d;/^--$/d' | cut -d' ' -f1); do
waybar -c "$XDG_CONFIG_HOME"/waybar/config-$CALLED-$m &
done
else
waybar
fi