You are not logged in.
Hi to all,
i just need your opinion about onething:
I use a laptop with a hub (an hp hub with DP, some usb, network ).
I connect my external screen via DP to the hub.
I have my laptop on the right and the big screen in front of me, so each time i start i have to launch
xrandr --output DP-1-1 --mode 1920x1080 --left-of eDP-1 --autoNow is it better to insert the command on my .xinitrc file where i start xmonad for my standard user or in xorg.conf or i don't know why?
Thanks
Last edited by gabtram (2023-07-20 12:12:25)
Offline
Offline
Hi installed the package,
then following this other topic: https://bbs.archlinux.org/viewtopic.php?id=279446, i tried to configure.
So i created a script in
/home/user/script/switch_monitor.sh. The file is executable
#!/bin/bash
# Set the desired resolution and position for your external display
xrandr --output DP-1-1 --mode 1920x1080 --left-of eDP-1 --autoThen i changed my .xinitrc file as follows
# Start x-on-resize
x-on-resize -c /home/user/script/switch_monitor.sh
#Xmonad start
exec xmonad
~But on the startup, after inserting user and pass in the prompt, i have a black screen. Also when i launch
x-on-resize -c /home/user/script/switch_monitor.sh i have blank screen.
Sorry i'm trying to do something but i lack some knowledge.
Thanks anyway
Bye
Offline
x-on-resize acts when you change the configuration (ie. attach/remove the dock)
Also x-on-resize blocks, so either your xinitrc (which is btw. broken, last link below) is irrelevant (how do you start the session?) or "exec xmonad" is never reached.
To configure the outputs merely at the start of the server the best approach is defined by how global you want it to be.
If you're the only user or every user wants that exact configuration, https://wiki.archlinux.org/title/Multih … _xorg.conf is by far the best approach.
If you don't want the behavior to be global, run xrandr before xmonad in your xinitrc (do NOT fork the xrandr call) to have the outputs in place before the WM starts.
Offline
Hi Seth,
thanks for the specification. So this is correct
# Start x-on-resize
x-on-resize -c /home/user/script/switch_monitor.sh
#Xmonad start
exec xmonadi deleted the lasta line
In my case i think the best approach is to insert
xrandrbefore xmonad execution.
I'm configuring this machine to made also some live performance and so i will use my laptop with my docking with another screen (and i don't know if it could be an hdmi, DP or vga). Maybe i have to find a more general way.
But in the meantime thanks!!!
Offline
So this is correct
x-on-resize blocks, so either your xinitrc (which is btw. broken, last link below) is irrelevant (how do you start the session?) or "exec xmonad" is never reached.
xrandr
That will just print the current output configuration.
The server will, by default, enable all outputs present when it starts and any of this here isn't relevant for some one-off situation, but to automize regular configurations.
Ifyou're the only user of the system, use the xorg configlet.
Offline
Ok. It solve my issue!
Offline
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Offline
Sorry,
i was thinking it worked but today i insert this configuration in my xorg.conf
To bring this
xrandr --output DP-1-1 --mode 1920x1080 --left-of eDP-1 --autoSection "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
##Docking Display port conf
Section "Monitor"
Identifier "DP-1-1"
Option "PreferredMode" "1920x1080"
EndSection
Section "Monitor"
Identifier "eDP-1"
Option "PreferredMode" "1920x1080"
EndSection
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Intel Graphics"
Monitor "DP-1-1"
Option "Monitor-DP-1-1" "1920x1080_60.00"
Option "Monitor-eDP-1" "1920x1080_60.00"
Option "LeftOf" "eDP-1"
EndSection
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
Option "AllowNVIDIAGPUScreens"
Option "Xinerama" "on"
EndSection
##End DP confBut it not extend the screen but also allow me to use also the screen. Why?
Offline
Because that's incorrect: https://man.archlinux.org/man/extra/xor … #Option~51 belongs into the Monitor section.
Also don't write a static server config, that's only gonna get you in trouble (and there's a bunch of cruft inside the particular one)
Section "Monitor"
Identifier "DP-1-1"
Option "PreferredMode" "1920x1080"
Option "LeftOf" "eDP-1"
EndSection
Section "Monitor"
Identifier "eDP-1"
Option "PreferredMode" "1920x1080"
EndSectionis all that should™ be necessary.
Edit: if not, post an xorg log, https://wiki.archlinux.org/title/Xorg#General - this might be a hybrid system w/ reverse prime.
Last edited by seth (2023-06-26 13:19:09)
Offline