r/windowmaker • • Oct 27 '26

Question Howto switch between different monitor setups

WM is great. I like the NEXTstep look & feel. I use it as my daily driver for several weeks now. But I am not sure how to handle different monitor setups especially when working on notebook. I use autorandr with matching profiles. But WM doesn't recognize the switch correctly and "loses" windows out of monitor range, so I can't reach them. Also dock and app icons get messed up on the screen. Restarting WM mostly brings dock and app icons back into position but windows get stuck somewhere.

And, when starting WM I also cannot get the right monitor setup from beginning. I have to run autorandr afterwards and this will need a restart of WM also. I would like to automate this.

How do you handle this?

4 Upvotes

9 comments sorted by

3

u/jcarnat Oct 27 '26

The magic trick here (OpenBSD) is to add
`pkill -usr1 -lf "/usr/local/bin/wmaker --for-real"` after the call to `xrandr`.

2

u/M1buKy0sh1r0 Oct 27 '26

Thanks, I will try that

2

u/gryf73 29d ago

I have well-organized ~/.xinitrc file which deals with whole pre wmaker X things for me. On one machine (work laptop) I do have GDM, so all of the things are in ~/.xsession (also needed to install xorg-11-xinit-session).

This file (either ~/.xinitrc or ~/.xsession) have following things run after X start, but before wmaker:

  • Screen setup with xrandr (or whatever automation you like, but I have rather static setup, except the one on laptop)
  • setting X resources (I have rather complicated configuration for urxvt and some other apps), also important thing is to set proper Xft.dpi
  • set up keyboard layout, rate, mouse acceleration, dpms
  • run dbus (only for starting without GDM)
  • running some X apps, like

    • dunst
    • xbindkeys
    • redshift
    • parcellite
    • flameshot
    • couple of other things, depending on the machine
  • and finally run wmaker

So that I don't need to restart wmaker on first run. For subsequent restarts, it'll be probably needed to restart wmaker, so it will remap the new layout, although I don't need to do that on my builds (either on Fedora nor Gentoo), as I have it both compiled with RandR, so wmaker will automatically restart after layout change.

As for the unreachable windows - a workaround for me is just using keyboard shortcuts for bringing them to visible space - under keyboard user pref in WPrefs there are "Move/resize active window", "Move to left/top/right/bottom head", "Move to right/bottom/left/top head", "Maximize active window XXX half" (there are 4 directions, and 4 directions for corners placement), but for those you'll also need to select "Allow move half-maximized windows between multiple screens" in expert prefs.

1

u/M1buKy0sh1r0 29d ago

Nice! Compiling wmaker with RandR sounds very promising. And also thanks for the WPrefs keybinding settings. I thought about creating my own as I wasn't quite familiar with all those custom settings in WPrefs yet. So in combination this will do the trick I think.

1

u/M1buKy0sh1r0 29d ago

u/gryf73 Awesome! I did not need to rebuild wmaker. It was already compiled with xrandr. So, fixing my autostart as suggested by moving autorandr from WMaker autostart to .xinitrc did the trick. Also, I added a keybinding for moving windows (almost to easy in Wprefs). When switching between monitor setups e.g. multimonitor to single build in display autorandr comes into play again an wmaker replaces dock and mini icons. It's not 100% perfect but works mostly, definitely an improvement.

1

u/M1buKy0sh1r0 29d ago

u/Savven you may also give it a try.

2

u/gryf73 29d ago

Glad you've managed that. Also, the drawback for having applications in wmaker's autostart is, when such app survives wmaker restart (the X server is not restarting during that process) than it may happen, there will be another instance of the app run, which may be unexpected. Running apps which parent is X server rather, than window manager can be beneficial for building the your environment around the wmaker.

1

u/Savven Oct 27 '26

I've been dealing with a similar issue for sometime, and ultimately gave up😭 I hope you manage to find a solution 

1

u/rafaelruscher 28d ago

VocĂȘ pode testar o meu projeto?
https://github.com/big-windowmaker
Quero saber se estou com o mesmo problema que vocĂȘ relatou!

Grato
Ruscher