Polybar Mirrored Laptop/HDMI Monitor i3 workspaces issue

Hey guys. I’ve got something going on with polybar and thought maybe some of y’all had already figured it out.

Polybar’s i3 workspaces disappear when I plug in my hdmi monitor to my laptop. When I just use the laptop the workspaces are visible.

I tried setting monitor in i3’s config and in the polybar config under i3 bar but it still disappears.

My xrandr setup is mirrored between eDP1 and HDMI1.

Any ideas?

It turned out to be more of an xrandr issue. I used the following script then made sure it loads via .xprofile to get it to work right.

basically it just toggles off my laptop screen if my monitor is plugged in which is what I want since I always do mirrored displays then shut the lid

I’ll mark this solved.


if xrandr | grep "$extern disconnected"; then
    xrandr --output "$extern" --off --output "$intern" --auto
    xrandr --output "$intern" --off --output "$extern" --auto