Xmobar does not fill complete screen on hidpi screen
Closed this issue · 15 comments
I installed xmonad based on your config on a fresh Ubuntu 16.04 with a 27" Dell 4k monitor.
The xmobar on the top only fills about 70 percent of the top. The last 30 percent shows the desktop picture.
There is a fix for this -- it involves customizing xmobarrc and then using mod-q to recompile xmonad to see your changes. This is mentioned (though not documented in detail) here: https://github.com/davidbrewer/xmonad-ubuntu-conf#editing-xmobarrc
I've commented xmobarrc pretty thoroughly, but the line you want reads like this:
position = TopW L 95,
That last number, 95, is the percentage of the screen you want the bar to cover. Because the little tray widget (stalonetray) is a fixed size, this means that you have to mess with the percentage based upon your screen size to make sure that you are using all the available space but not overlapping with the tray. With a high resolution screen, you'll probably have to bump it up a percentage or two.
I'm going to close this ticket with this comment as I think I've addressed it, but if you still have any problems please feel free to reopen!
Hi David,
I actually have seen the code and comment. The thing is that changes in the position param are not reflected. I can still see some empty space even though i set it to 99
That's definitely strange -- I just tried this out and it's working for me. To be totally clear -- are you recompiling after each change by hitting mod-q? Should cause the screen to redraw (and put you back on your default workspace) and the change should take effect.
If you change that percent to something very low, say 50, is it clear that any change is happening? If not, is there a chance that you have multiple copies of this file and you're editing the one that Xmonad is not looking at?
Also, to be clear on my end -- I'm testing this on 14.04 at the moment, as I haven't yet moved my work computer to Xenial. So there's some chance that this could be an issue between Ubuntu versions, though I think that's unlikely.
Ok, I just did some debugging. First the setup is fine, I can see shrinking if i change it to 80 or smaller. The problem is that even though I set it to 100 there is still like 2 inch space between the data/time and the tray bar. Any idea what is causing it?
Hmmm. Maybe take a look at the last line of xmobarrc, where the "template" for what appears in the bar is set. By default it looks like this:
template = "%StdinReader% }{ %battery% | %cpu% | %memory% | Vol: %myvolume% <fc=#e6744c>%date%</fc> "
Note the extra spaces after the date -- any spaces after the date will push it left of the end of the xmobar.
Also, is your desktop background black? If so, you might try temporarily changing the color of xmobar in order to be able to see clearly exactly where the bar ends. That might help determine if there is a big space inside the bar but after the date, or if the bar itself is too short. You would change the color on roughly line 17 of xmobarrc:
bgColor = "black",
It is because the bar is too short. I have tried the space after date.
Seems like maybe the percentage positioning just doesn't work right on a hidpi display. Googling around a bit I've seen people using an alternate format for that position argument which looks something like this:
position = Static { xpos = 0, ypos = 0, width = 1440, height = 16 },
Do you have any better luck replacing the position parameter in xmobarrc with something like that, filling in the appropriate width for your screen? I'm not totally clear on if that form of the position argument is only available in a certain version of xmobar.
Thanks, the static works. I think the percentage issue might be a bug.
Either static way or the buggy percentage style is all fine for me. Thx for your time
Sure thing! I learned something today too -- had no idea there was a static sizing option. :-)
By the way, I've also only recently learned of the existence of Taffybar, which sort of provides the functionality of xmobar and stalonetray in one piece of software: https://github.com/travitch/taffybar. At some point when time allows I may look into replacing those two items with Taffybar, which could simplify the sizing issue somewhat.
Yeah, I know some xmonader use it. I might take a stab later. I will update you on it if I have something
@davidbrewer Hi david I actually get the things working. If you check my fork w/in the branch taffybar, you can see the way to install taffybar and a default config that works. The only problem is that I can properly launch taffybar :( I have to open a terminal and run taffybar &
by hand.
I fixed it, Hooray!
You can take a look at install-xmonad, start-xmonad and the taffybar to see what I have done.
I think the setup in branch taffybar is pretty decent, check it out!
And just a quick reminder that the pager is clickable, amazing!