7

I am using vmware to run arch linux. I have setup i3-gaps and everything is setup correctly while using lemonbar, however, my only problem is that lemonbar is set for the current resolution. When I resize VMware, the resolution changes and the bar is not displayed correctly anymore. What would be the best way to refresh the resolution when I resize the vmware window?

I am using the latest VMware fusion 8.1. At the moment, I am using lemonbar which finds the current resolution via by using xrandr -q and using awk to get the width of the current res.

1

One thing you could do is monitor the X11 log through i.e. tailf /var/log/Xorg.0.log.
I don't know how VMware changes the resolution, but it likely logs a message to the log when it does, something like:

[ 55152.166] (II) modeset(0): Allocate new frame buffer 6548x2160 stride

This log usually is readable by a normal user, so you wouldn't need root for it.
If you use tailf instead of tail -f, it should theoretically take even less resources too (see this answer.)

Alternatively, if VMware uses a command to change the resolution on resize, you could "hijack" that command and replace it with your own wrapper command, have it do what you need it to do and then run the original command afterwards.
As I don't use VMware I'm not sure how they handle this exactly, so I don't know if this would work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.