You are not logged in.
Hello,
I've installed arch with dwm. I'm using a two monitor setup, with my laptop and a separate monitor. The separate monitor was setting as primary by default on startup of X, but when I fixed the screen tearing problem by adding vsync through /etc/X11/xorg.conf.d/20-intel.conf, the primary display was my laptops screen by default. I can still change it by running:
"
xrandr --output HDMI1 --auto
xrandr --output HDMI1 --primary
"
manually, but I couldn't find a solution on how to run these commands on the startup of X.
I tried modifying ~/.xinitrc with the commands above (with and without "exec" at the beginning), but it didn't help. Any help would by appreciated.
P.s. An option where the laptop screen is disabled would also work, since I'm not using it on my desktop. But it would be nice to have it active when the HDMI isn't connected
[edit] I didn't mention it in the O.P. at the beginning, but the screen would also set itself to a lower resolution.
Last edited by peonerovv (2021-10-08 18:17:08)
Offline
/etc/X11/xorg.conf.d/11-monitor.conf
Section "Monitor"
Identifier "HDMI1"
# Option "Enable" "False" # defaults to true
Option "Primary" "True"
EndSection
Section "Monitor"
Identifier "eDP1"
# Option "Enable" "False" # defaults to true
Option "Primary" "False"
EndSectionReplace eDP1 w/ the actual output name from "xrandr -q"
I tried modifying ~/.xinitrc
Do you actually use startx/xinit?
Please post your xinitrc (attempts)
Offline
/etc/X11/xorg.conf.d/11-monitor.conf
Section "Monitor" Identifier "HDMI1" # Option "Enable" "False" # defaults to true Option "Primary" "True" EndSection Section "Monitor" Identifier "eDP1" # Option "Enable" "False" # defaults to true Option "Primary" "False" EndSectionReplace eDP1 w/ the actual output name from "xrandr -q"
I tried modifying ~/.xinitrc
Do you actually use startx/xinit?
Please post your xinitrc (attempts)
I tried using your solution, but it didn't work. (with and without comments) (my laptop screen is called eDP1).
Here are the attempts, that I wrote in .xinitrc
exec dwm
exec xrandr --output HDMI1 --auto
exec xrandr --output HDMI1 --primaryexec xrandr --output HDMI1 --auto
exec xrandr --output HDMI1 --primary
exec dwm(I also tried the same thing, but without "exec" before xrandr commands, just in case)
Last edited by peonerovv (2021-10-08 16:23:35)
Offline
Nothing after the first "exec" line will be executed. So you'll have to run "xrandr --output HDMI1 --primary" first and finish w/ "exec dwm"
Also the xinitrc is broken (see the last link below) and if you could still login w/ an xinitrc that starts w/ "exec xrandr --output HDMI1 --auto" you're not using xinit to start the session itfp.
=> How do you login?
Offline
I'm running X with "startx" in my .bash_profile.
Yes, putting "xrandr --output HDMI1 --primary" before "exec dwm" made it primary on startup, but I just realized that I forgot to mention that my resolution defaults to 1280x720 and mirrors the laptop display. In the meantime I tried putting
xrandr --output HDMI1 --primary --mode 1920x1200 --rate 59.95but it doesn't seem to work. Again, I'm able to pass these commands manually, but not in the .xinitrc
Offline
I just solved it.
I had to write
Section "Monitor"
Identifier "HDMI1"
Option "PreferedMode" "1920x1200"
Option "Position" "0 0"
Option "Primary" "true"
EndSection
Section "Monitor"
Identifier "eDP1"
Option "LeftOf" "HDMI1"
EndSectionIn the /etc/X11/xorg.conf.d/10-monitor.conf. You recommended writing in 11-monitor.conf, instead of 10-monitor.conf. I don't really know what's the source of this error, but it works now!
Thanks for help!
Offline
The index doesn't matter (unless there had been a 10-monitor.conf before) but your latest installment doesn't only (activate and) set the primary the output but also defines a mode for HDMI1 and a relative position for eDP1
This is btw. bogus: you set HDMI1 to 0x0 and then eDP1 left of it.
Since you'll always have the eDP with you but not necessariry the HDMI, I'd consider
Section "Monitor"
Identifier "HDMI1"
Option "PreferedMode" "1920x1200"
Option "RightOf" "eDP1"
Option "Primary" "true"
EndSectionAlso your xinitrc is still broken and you should really fix that to avoid further issues (typically around an inactive session: mounting devices and shutting down w/o root permissions etcetc)
Offline