View previous topic :: View next topic |
Author |
Message |
KShots Guru
Joined: 09 Oct 2003 Posts: 591 Location: Florida
|
Posted: Thu May 19, 2016 2:48 pm Post subject: Advanced screen management under plasma [SOLVED] |
|
|
I have an interesting configuration... I have a laptop with a built-in 4k screen when I'm mobile... and when I'm docked, I have four 1080p screens (plus the built-in 4k screen).
This presents an interesting set of problems, including different graphics card (the docking station includes a desktop graphics card at a different PCI bus id) which triggers a different X11 config when docked, differing DPI settings, and other headaches.
I've been able to get X11 to automatically use the appropriate configuration through some systemd magic with the following unit files:
optiswitch-bi.service
Code: | [Unit]
Description=Built-in GTX 980 setup
Before=display-manager.service
ConditionPathExists=/sys/bus/pci/devices/0000:01:00.0
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/bin/ln -sf /usr/local/share/optimus/bi.sddm.conf /usr/share/sddm/scripts/Xsetup
ExecStartPre=/bin/ln -sf /usr/local/share/optimus/bi.home.conf /home/rich/.xinitrc
ExecStartPre=/bin/ln -sf /usr/local/share/optimus/bi.home.conf /home/kshots/.xinitrc
ExecStart=/bin/ln -sf /usr/local/share/optimus/bi.conf /etc/X11/xorg.conf.d/30-device-nvidia.conf
[Install]
WantedBy=multi-user.target | optiswitch-ga.service Code: | [Unit]
Description=Alienware Graphics Amplifier setup
Before=display-manager.service
ConditionPathExists=/sys/bus/pci/devices/0000:02:00.0
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/bin/ln -sf /usr/local/share/optimus/ga.sddm.conf /usr/share/sddm/scripts/Xsetup
ExecStartPre=/bin/ln -sf /usr/local/share/optimus/ga.home.conf /home/rich/.xinitrc
ExecStartPre=/bin/ln -sf /usr/local/share/optimus/ga.home.conf /home/kshots/.xinitrc
ExecStart=/bin/ln -sf /usr/local/share/optimus/ga.conf /etc/X11/xorg.conf.d/30-device-nvidia.conf
[Install]
WantedBy=multi-user.target | Essentially, systemd detects if the docking station device exists, and if it does it links the appropriate configs in before starting X11. The docking station removes the built-in graphics card (it disappears from lspci and the sys tree), so it's mutually exclusive. This part seems to work well... the quad-monitor setup places the monitors in the correct locations when docked, and when not docked, nvidia optimus is engaged via the appropriate xrandr commands in sddm and user xinit scripts. I'm happy with this much of it. However, when I dock, the DPI is set so that everything is HUGE (254 DPI), and if I fix it to 92 DPI as is appropriate for a 1080p screen of the size I'm using, when I undock everything is horrendously tiny on the 4k screen (which requires 254 DPI).
I've been able to set my DPI manually every time via KDE, but I would much rather do this automatically like I do with the above systemd unit files.
Anybody know how plasma stores its DPI settings? Is it a flat file? A database entry?
In case anyone's curious, here's the two X11 configs as well:
bi.conf Code: | Section "Module"
Load "modesetting"
EndSection
Section "Device"
Identifier "mydevice"
Driver "nvidia"
BusID "PCI:1:0:0"
Option "ConnectedMonitor" "CRT-0"
Option "CustomEDID" "CRT-0:/sys/class/drm/card0-eDP-1/edid"
Option "UseEDID" "true"
Option "AllowEmptyInitialConfiguration"
EndSection | ga.conf Code: | Section "Module"
Load "modesetting"
EndSection
Section "Device"
Identifier "mydevice"
Driver "nvidia"
BusID "PCI:2:0:0"
Option "nvidiaXineramaInfoOrder" "DFP-0"
Option "metamodes" "DVI-I-1: 1920x1080_144 +1920+0, HDMI-0: nvidia-auto-select +3840+0, DP-4: 1920x1080_144 +0+0"
EndSection |
Note that I'm taking the EDID from the intel module when using the built-in card, as optimus prevents the nvidia driver from seeing EDID information... but when I'm using the docking station, optimus is not standing in the way, so I don't do anything special for EDID. _________________ Life without passion is death in disguise
Last edited by KShots on Tue May 24, 2016 5:43 pm; edited 1 time in total |
|
Back to top |
|
|
KShots Guru
Joined: 09 Oct 2003 Posts: 591 Location: Florida
|
Posted: Tue May 24, 2016 5:42 pm Post subject: |
|
|
Found the culprit - I had forgotten that I had also updated /etc/sddm.conf to a DPI of 144. This had the effect of ignoring my ~/.xinitrc xrandr statement regarding DPI and overriding it with 144 every time, no matter which configuration I was in. I have since updated my system unit file to symlink in an appropriate /etc/sddm.conf for each hardware configuration, and now plasma has the correct DPI every time I log in. It was driving me nuts that apparently my ~/.xinitrc was being ignored... I don't think it was, I think it was being applied first, then sddm came in and stomped on it with its own DPI settings. If it was being ignored, I would get a blank screen on login when in standalone mode (optimus doesn't work without xrandr in the ~/.xinitrc). _________________ Life without passion is death in disguise |
|
Back to top |
|
|
otakugeek n00b
Joined: 26 Jun 2014 Posts: 50
|
Posted: Wed Jul 20, 2016 7:46 pm Post subject: |
|
|
Do you have a Alienware machine ?
if yes please could share some screens and systems information ?
I want buy a Alienware 17 R3 the last of year and I'm afraid about the drivers and all resources, as the 4k screen, wifi network or nvme.
I'm a ROG 750JX and I have alot of work to make all devices work. |
|
Back to top |
|
|
KShots Guru
Joined: 09 Oct 2003 Posts: 591 Location: Florida
|
Posted: Wed Jul 20, 2016 10:27 pm Post subject: |
|
|
otakugeek wrote: | Do you have a Alienware machine ?
if yes please could share some screens and systems information ?
I want buy a Alienware 17 R3 the last of year and I'm afraid about the drivers and all resources, as the 4k screen, wifi network or nvme.
I'm a ROG 750JX and I have alot of work to make all devices work. | Yeah, I'm using an Alienware 17r3. Not sure what you mean by "posting some screens", but I can post some stuff on getting everything working except the audio jacks (which are not likely to ever work). I've also got a mostly-working solution on using the Graphics Amplifier, so I can dock with 4 monitors and travel with just the 4k display. The only part that's not working right is that Plasma seems to shuffle my monitor positions around randomly when I undock and re-dock, ignoring my X11 config stating where each one should reside, and making me go through their configuration interface every time.
I have an old thread describing my experience with a lot of the old issues. I don't think I mentioned the audio jack issue, but I honestly didn't notice it until several months in when I wanted to have some audio in an airport and it ignored my headphones. Solution: Buy a USB audio dongle. _________________ Life without passion is death in disguise |
|
Back to top |
|
|
otakugeek n00b
Joined: 26 Jun 2014 Posts: 50
|
Posted: Thu Jul 28, 2016 3:19 pm Post subject: |
|
|
Please post some screenshots or a teaser on youtube, Linux on gamer laptop is very rare is amazing someone that use a high top laptop with genuine Linux. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|