Fluxbox, configure an external monitor

fluxbox hdmi linux tips vga xrandr

One problem I still haven't solved with fluxbox is how to manage multiple monitors resolutions.
More specifically, I can stream the output over multiple monitors, I can have multiple resolutions, but fluxbox sizes itself considering only the first screen resolution.

For example if I boot my machine with an external VGA monitor connected, the system boots and both the VGA monitor and the laptop monitor work (even if the laptop monitor is closed). The problem here is that my laptop monitor has a 1366x768 resolution, while the external monitor is fullHD. So what happens is that I'll have the maximum resolution supported by all active monitors (1366x768) and so my fullHD monitor looks very ugly!

I learned playing with xrandr command to adjust things, so I know I can change the resolution mode of my VGA monitor this way:

$ xrandr --output VGA1 --mode 1920x1080

And here something weird happens. The external monitor resolution is correctly set to 1920x1080 (full hd), but I see something like two desktop backgrounds, one for the old resolution and one for the new one, also fluxbox size itself considering the laptop monitor dimensions and so for example the toolbar does not cover the 100% of the external monitor even if I restart fluxbox.

I have to say that I probably have some configuration problems with Xorg, since I can't even run X -configure without errors and I don't have an xorg.conf file, so maybe these things have something to do with what I experience.

The problems can be solved turning off the laptop monitor before changing the external monitor mode. I also run conky as system monitor, and it has also to be repositioned when changing resolution.

So I've written a simple script that does all this things for me, and when I used an external monitor now, I only need to launch the script after the login in order to have a working fullHD resolution on my external monitor, here comes the script:

# turn off the laptop monitor
xrandr --output LVDS1 --off
# change the VGA monitor resolution to fullHD
xrandr --output VGA1 --mode 1920x1080
# kill the running conky process
kill -9 `ps ax | grep conky | awk 'NR==1' | sed 's/^ \([0-9]*\).*/\1/'`
# restart conky
conky -c /home/abidibo/.conky/conkyrc_orange

That's it, save this script in a file.sh, give it execute permission and you may configure your external fullHD monitor in one shot.

Subscribe to abidibo.net!

If you want to stay up to date with new contents published on this blog, then just enter your email address, and you will receive blog updates! You can set you preferences and decide to receive emails only when articles are posted regarding a precise topic.

I promise, you'll never receive spam or advertising of any kind from this subscription, just content updates.

Subscribe to this blog

Comments are welcome!

blog comments powered by Disqus

Your Smartwatch Loves Tasker!

Your Smartwatch Loves Tasker!

Now available for purchase!