-
Notifications
You must be signed in to change notification settings - Fork 304
Update MonitorSetup to fix the primary monitor. #578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
output the primary monitor first in the list
|
Well, I jumped to conclusions. As for the |
|
Hello, i dont understand, what need to be fixed? |
|
|
|
Is there a solution where the user doesn't have to edit another file like bspwmrc or interact with it to find and set their primary monitor? |
|
Yes, this is possible. Instead of editing the bspwmrc file, you can use programs to edit the xorg.conf file. In my case, nvidia-settings helped. There may be other ways. In general, any working method for changing the monitor priority will work. |
|
I've made the changes you suggested locally; well, it's just the xrandr command with the flag to list active monitors. |
|
I did it that way because at my job I'm constantly connecting and disconnecting the external/secondary monitor; it's never permanently connected. This works for me because i only connect it and press Super + Alt + R to restart bspwm, the monitor activates and configures itself. But of course, I overlooked the fact that some people need to configure their monitors specifically. |
|
The main idea is to sort the list so that the primary monitor is first in the list. This is necessary because the remaining code uses the first monitor in the list as the primary. You can also use |



The special feature of
xrandr --listactivemonitorsis that the first monitor in the list will be the primary monitor. This is very convenient because the rest of the script uses the first monitor in the list as the primary monitor. This allows you to set the primary monitor once usingxrandr --output HDMI-0 --primaryin the terminal or a third-party application likenvidia-settings.