Reply to topic

Automate display scale at login

jflorian
Registered Member
Posts
2
Karma
0

Automate display scale at login

Mon Nov 13, 2017 4:02 pm
My $HOME is NFS-based and I have several workstations from which I use it. My primary workstation now has a high-DPI display. I used System Settings > Display and Monitor > Scale Display to find a reasonable setting for my comfort. While a setting of 1.5 or so was ideal, I had to go all the way to 2.0 because I also use some GTK-based apps and they don't do fractional scaling. With both Qt and GTK scaling at 2.0x, I then used xrandr --output DP-0 --scale 1.5x1.5 in a Pre-KDE Startup script to get both to where I really wanted them. This makes a good setup for my primary workstation.

But now everything is HUGE on the other workstations, of course. I've tried going down the rabbit hole of adding a case block to that startup script that's conditioned on the hostname and using xrandr to return the other workstations to their original 1x scaling, but that's proving difficult. I think the best, simplest solution would be if my pre-startup script had a way of setting the scaling factor that I can adjust via System Settings, but in an automated way.

Does anyone know how I send a command over DBUS to achieve this?
airdrik
Registered Member
Posts
990
Karma
1
OS

Re: Automate display scale at login

Tue Nov 14, 2017 7:59 pm
Another idea would be to set up the scaling stuff in a folder that's local to each workstation; either in the system-wide settings (/etc) or possibly another folder which you can link to from your mounted $HOME (assuming you have access to make such changes - or request that such changes be made if you don't). This could also benefit other users of those workstations as they could also get workstation-appropriate scaling when using them.

As for a DBus-based solution, you can use the qdbus command or qdbusviewer gui (from the qt5-dev-tools (or qt4-dev-tools) package) to explore the DBus interfaces that are exposed by different applications.


airdrik, proud to be a member of KDE forums since 2008-Dec.
jflorian
Registered Member
Posts
2
Karma
0

Re: Automate display scale at login

Thu Nov 16, 2017 11:24 pm
I don't follow you with folder idea. What exactly are you suggesting I put in them? This is a home domain so I am the sole administrator and decision maker. If I can make this work for me, I can make it for the only other user, my spouse.

I think I've encountered qdbusviewer once before but had completely forgotten about it. That's a good start for exploration but unfortunately I'm still just as lost. I searched for "scale" and "display" and found absolutely nothing. I drilled down into org.kde.plasmashell but I really don't know what I'm looking for. I've also tried using the dbus-monitor while interacting with the System Settings page for the display scale but didn't see any events that looked relevant. Maybe that's not even done over DBUS. I don't really know where this scaling is happening exactly, excluding what I can do with xrandr. Since GTK and Qt handle this differently, I assume it's local to each framework. I'm merely guessing that the System Settings page is just a controller issuing DBUS commands to some receiver that actually acts upon them.
airdrik
Registered Member
Posts
990
Karma
1
OS

Re: Automate display scale at login

Mon Nov 20, 2017 7:50 pm
Ah, I was figuring that using NFS mounted home directories that this was some kind of an office environment.

In this case I would recommend that instead of trying to issue dbus or xrandr commands at login (which you'd want to do for both your and your spouse's logins), that you configure the each workstation (in /etc/X11/xorg.conf) with the settings relevant to that workstation and leave the screen/scaling settings out of the users' home directories.

If that's not feasible, you can create the scaling script in a well-defined location (like /usr/local/bin) on each workstation which sets the scaling up the way you want and then add that to the users' startup scripts.

Delving into the source for KScreen, in the Scaling config code it looks like KScreen uses xrdb commands to update the scale. So no DBus solution from what I can tell, however further investigation on the command KScreen runs and what xrdb does will likely yield information on how to customize the per-workstation settings.


airdrik, proud to be a member of KDE forums since 2008-Dec.

 
Reply to topic

Bookmarks



Who is online

Registered users: Bing [Bot], burnessduan, Clancularius, Exabot [Bot], Google [Bot], Majestic-12 [Bot], ScottBeebiWan, Sogou [Bot], Yahoo [Bot]