You are not logged in.
I'm using Gnome (but I'd like a general solution that'd work even if I switched to anything else).
Problem is that unless the screen is attached at boot already (aka I plug it in later, or attach the laptop to the dock station) the screen doesn't get turned on until I run "gnome settings". No need to set anything there, just need to run the applet and then it detects screens.
So what does it do? How can I automatize that?
Thanks
Last edited by rowra (2015-10-17 22:44:09)
Offline
I would just add an `xrandr` command to ~/.config/autostart but I suspect there is a more "correct" method.
EDIT: My apologies, I completely misread the question.
Last edited by Head_on_a_Stick (2015-10-17 20:13:40)
Jin, Jîyan, Azadî
Offline
Write a udev rule: https://wiki.archlinux.org/index.php/Udev
Offline
Write a udev rule: https://wiki.archlinux.org/index.php/Udev
Thanks, I'll look into that. For now just a clarification of the question:
echo /sys/class/drm/*/status
does return a good handful of disconnected and only one connected (the built-in screen)
And the second screen (connected via DVID to the dock) only becomes "connected" when some magic-script-thing is run by something like the gnome-settings
edit the following code does initialize the second screen the way I want (mirrored):
xrandr --output LVDS1 --mode 1920x1080 --output HDMI3 --mode 1920x1080 --same-as LVDS1
Now I only need to look into udev rules to automatize it. Plus it'd be nice to get the variables (LVDS1, HDMI3) automatically too? Not that physical ports can wander around or anything, just to be more universal? Any ideas on that?
Last edited by rowra (2015-10-17 20:26:07)
Offline
You could awk/grep xrandr output for connected screens...
Offline
You could awk/grep xrandr output for connected screens...
udev rule doesnt work somehow..
/etc/udev/rules.d/95-monitor-hotplug.rules looks like:
KERNEL=="card0", SUBSYSTEM=="drm", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/mark/.Xauthority", RUN+="/usr/local/bin/hotplug_monitor.sh"
And nothing happens on hotplug. (Script run manually does work and exist)
Offline
Offline
There is something weird going on. I found out that Gnome does this automatically. If the laptop is docked (built in screen open and active) and then I plug in the secondary screen (into the dock, DVI), then it does get detected and attached.
However if the secondary screen is already attached to the dock, and I just dock the laptop, it does not get detected (aka it does not get sensed as a monitor plugged in).
The problem is, that even with a very own udev rule, the rule works and executes just fine in the first case, but nothing happens in the latter.
So, any idea on how I can trick this?
(Oddly, xrandr does find it and once it's run it's back in the business again)
Last edited by rowra (2015-10-17 21:46:32)
Offline
I got it working. The only workaround possible was to find out when it's connected to the dock (since apparently the dock itself handles the screen and therefore some weird magic is going on there in the background). The dock shows up as a USB device, so I could write a udev rule for that.
Also the only way I could makeit work (for now) was by calling a script that does nothing but call in another script with "/bla/bla/script &" and this way it actually executes properly.
Also, Xauthority is NOT in my home folder, but rather in /run/user/1000/gdm/Xauthority, since I'm (forced to be) using gdm (for the new GOA)
Thanks for the replies and the help, closing
Offline