You are not logged in.
On my laptop I have a relatively convenient setup with xmonad and dzen2, but recently I started using a large monitor and I find myself switching between laptop and the monitor screen. My problem is that the monitor is HiDPI and a lot of settings have to be adjusted. I now have a special Xresources that I run after connecting. It runs as part of the script which kills and resprawns two dzen2 bars with different settings to adjust for resolution change. I am wondering if there's a more elegant way of sorting out this problem. Ideally I would like to just replace this setting in .xmonad.hs
myXmonadBar = "dzen2 -x '0' -y '0' -h '30' -w '1200' -ta 'l' -fg '#FFFFFF' -bg '#1B1D1E'"
myStatusBar = "conky -c /home/rsa/.xmonad/conky.conf | dzen2 -x '1200' -y '0' -w '720' -h '30' -ta 'right' -bg '#1B1D1E' -fg '#FFFFFF'"with some relative heights and widths and fontsize based on the screen resolution. I found a few suggestions on this forum about dzen2 configurations, but couldn't find anything that discusses this problem. Please let me know if you can point me in the right direciton. Thank you.
Offline
I declare my dzen font setting (and -fg and -bg) in .Xresources, and then for individual instances only ever specifiy duration (-p): this works across both the laptop and external screens.
Offline
I think you can add an event hook to your xmonad config that matches on RRScreenChangeNotifyEvent. That seems to include the new width and height. You can have it run your script for you and/or kill/respawn dzen directly.
Last edited by Raynman (2018-07-21 18:42:56)
Offline
Thanks for feedback. I think the screen notify event is what I am looking for. I need to investigate this a bit more. It would also let me run nitrogen --restore.
@jasonwryan I am not sure how to pull it out with Xresources. I thought you fix only parameters like foreground and font there and the settings are per application rather than application instance. How would I differentiate between two dzen bars?
Right now, the only setting I have there for dzen2 is
dzen2.font: xft:inconsolata:size=10:antialias=trueOffline
Ah. When you said "switching between" I read that literally (that's my workflow: when I am docked I disable the laptop monitor and just use the external display).
Offline
Sorry, I may have misexpressed myself. That is exactly what I mean by "switching between": I turn off laptop screen, turn on the monitor or vice versa. I just have two dzen bars and I don't know how Xresources could be utilised to change a specific one. How do I change a width, height or position of a specific dzen2 bar?
Offline