Whenever the number of displays or the ports the displays are plugged into changes, hard-coded values in ~/.config/polybar/launch.sh has to be manually edited in order for the correct env vars to be handed to polybar for it to determine which displays to put the bars on. This issue is similar to the issues faced trying to determine which screenlayout script to run (which is now done via dot displays run).
A couple things that would be really cool are:
dot can take the monitors output by active_monitors=$(xrandr -q | grep " connected" | awk "{print $"${1:-1}"}" ORS=" ") (which looks like "DVI-D-0 HDMI-0 DP-4 " for example) and somehow intelligently guess which monitor is on the left, middle, and right.
dot is responsible for starting polybar, and handing environment variables polybar needs (currently it needs MONITOR_LEFT|RIGHT|MAIN)
i3 startup script calls dot to load polybar instead of calling ~/.config/polybar/launch.sh
Whenever the number of displays or the ports the displays are plugged into changes, hard-coded values in
~/.config/polybar/launch.sh
has to be manually edited in order for the correct env vars to be handed to polybar for it to determine which displays to put the bars on. This issue is similar to the issues faced trying to determine which screenlayout script to run (which is now done viadot displays run
).A couple things that would be really cool are:
dot
can take the monitors output byactive_monitors=$(xrandr -q | grep " connected" | awk "{print $"${1:-1}"}" ORS=" ")
(which looks like "DVI-D-0 HDMI-0 DP-4 " for example) and somehow intelligently guess which monitor is on the left, middle, and right.dot
is responsible for starting polybar, and handing environment variables polybar needs (currently it needsMONITOR_LEFT|RIGHT|MAIN
)~/.config/polybar/launch.sh