Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Screen-Scaling for applications running as sudo

If none of the specific sub-forums seem right for your thread, ask here.
Message
Author
Thomas123
Posts: 36
Joined: 2018-10-29 09:18

Screen-Scaling for applications running as sudo

#1 Post by Thomas123 »

I guess this does not just apply for KDE, but I'm not sure.

So I have scaled my screen by a factor of 1.4 in the KDE-screen-settings.

Now this seems to only apply to the normal user. And if I run apps as sudo, they appear much too tiny. How can I set a scale factor for those too?

Does anyone know this?

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Screen-Scaling for applications running as sudo

#2 Post by phenest »

Thomas123 wrote:... if I run apps as sudo ...
What apps are you running as root? And how are you invoking them, e.g. sudo gedit?
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

Thomas123
Posts: 36
Joined: 2018-10-29 09:18

Re: Screen-Scaling for applications running as sudo

#3 Post by Thomas123 »

Yes, particularly: sudo thunar

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Screen-Scaling for applications running as sudo

#4 Post by phenest »

Apart from the implications of running a non-root gui app as root, I doubt Thunar is supposed to be run that way which leads straight to the answer, which is that there is no way to fix your issue.

If you were referring to an app, that by its very nature needs to be run as root, that is, an app that prompts for the root password upon starting it, then that would be an issue.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

Thomas123
Posts: 36
Joined: 2018-10-29 09:18

Re: Screen-Scaling for applications running as sudo

#5 Post by Thomas123 »

Now this is strange ... Dolphin can't even run as sudo anymore. The dolphin context-menu-root-actions are also not supported anymore. Now you say the above about thunar.

... How can I copy, move, delete files which require root-privileges without using the terminal then?

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Screen-Scaling for applications running as sudo

#6 Post by phenest »

https://www.linuxuprising.com/2018/04/g ... heres.html

Thank Head_on_a_Stick for that one.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Screen-Scaling for applications running as sudo

#7 Post by Head_on_a_Stick »

Thomas123 wrote:sudo thunar
Use this instead if you want to run thunar with elevated privileges:

Code: Select all

pkexec thunar
But you really should use the shell instead (or mc).

And note that the GTK2+ toolkit employed by thunar does not allow for scaling of the UI elements so KDE-screen-settings [sic] cannot change that.

@phenest: the admin:// trick can only be used for editing or viewing files but not for moving or copying.
deadbang

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Screen-Scaling for applications running as sudo

#8 Post by phenest »

Head_on_a_Stick wrote:@phenest: the admin:// trick can only be used for editing or viewing files but not for moving or copying.
The link you provided says you can. So I just tested it, and you can cut/copy/paste files and folders. In Nautilus anyway.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Screen-Scaling for applications running as sudo

#9 Post by Head_on_a_Stick »

Oh really? In which case thanks for the correction and sorry for the noise :oops:
deadbang

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Screen-Scaling for applications running as sudo

#10 Post by phenest »

And thank you for the handy tip.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

Thomas123
Posts: 36
Joined: 2018-10-29 09:18

Re: Screen-Scaling for applications running as sudo

#11 Post by Thomas123 »

Thank you guys for your help!
Head_on_a_Stick wrote:

Code: Select all

pkexec thunar
Now this gives the same result as "sudo thunar": too small to use.

I tried Midnight Commander as you suggested. But it doesn't even support drag and drop. Just copying a file over into another folder seems to take 10 times as many clicks or keystrokes as normally.
Head_on_a_Stick wrote:And note that the GTK2+ toolkit employed by thunar does not allow for scaling of the UI elements so KDE-screen-settings [sic] cannot change that.
But how does thunar do the trick in the normal user mode then? There the size is just fine.

Also: The admin:// trick works in thunar. (Not in dolphin though) ... and the size is ofc just fine. But trying to open a file with kate from there gives a launcher message: "unknown protocol „admin“."

Right now this all looks to me like a regression in usability instead of progress.
Am I missing something here? Why has this simple thing gotten so complicated?

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Screen-Scaling for applications running as sudo

#12 Post by Head_on_a_Stick »

Thomas123 wrote:
Head_on_a_Stick wrote:

Code: Select all

pkexec thunar
Now this gives the same result as "sudo thunar": too small to use.
Yes but pkexec should always be preferred over sudo (if the program supplies a polkit configuration file, which thunar does) because it doesn't use elevated permissions for the entire GUI.
Thomas123 wrote:I tried Midnight Commander as you suggested. But it doesn't even support drag and drop. Just copying a file over into another folder seems to take 10 times as many clicks or keystrokes as normally.
Well just use the shell then. I always find that quicker than a GUI file manager, especially for batch operations. I don't even have a graphical file manager installed on my system :)
Thomas123 wrote:
Head_on_a_Stick wrote:And note that the GTK2+ toolkit employed by thunar does not allow for scaling of the UI elements so KDE-screen-settings [sic] cannot change that.
But how does thunar do the trick in the normal user mode then? There the size is just fine.
Hmm, OK, I'm clearly speaking out of my ass there then (again). Sorry about that. I have no idea how to make a root thunar scale properly.
Thomas123 wrote:Also: The admin:// trick works in thunar. (Not in dolphin though) ... and the size is ofc just fine. But trying to open a file with kate from there gives a launcher message: "unknown protocol „admin“."
The admin:// protocol is used by GVFS, which is a GNOME thing and so won't work with KDE applications.

This bug report suggests that running thunar under the normal user (ie, without using pkexec or admin://) and then opening the system file with Kate should still allow you to edit the file because Kate will offer a polkit authentication window when you try to save the file.
Thomas123 wrote:Why has this simple thing gotten so complicated?
There is a concerted effort under way be the developers of the various desktops to eliminate the bad practice of running GUI applications under root privileges, some adjustment may be required on the part of the user.
deadbang

Thomas123
Posts: 36
Joined: 2018-10-29 09:18

Re: Screen-Scaling for applications running as sudo

#13 Post by Thomas123 »

Thank you again!

This makes things a bit clearer ... though not easier.

A graphical file manager is in my experience a huge win in convenience and time saving. For me it would be horrible to give it up.

BTW: pkexec kate (or kwrite) ... also gives an error: QXcbConnection: Could not connect to display.

Well, anyways, thank you for your help!

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Screen-Scaling for applications running as sudo

#14 Post by Head_on_a_Stick »

Thomas123 wrote:BTW: pkexec kate (or kwrite) ... also gives an error: QXcbConnection: Could not connect to display.
You're not supposed to run Kate as root but it still should be able to edit system files if you run it as your normal user, at least according to my linked bug report. So you don't need to run thunar as root at all, to copy and/or move system files use the admin:// protocol.
deadbang

Thomas123
Posts: 36
Joined: 2018-10-29 09:18

Re: Screen-Scaling for applications running as sudo

#15 Post by Thomas123 »

Yes, true, ... but double the work:

First I navigate to the file as admin, to rename it.
Second I need to navigate there again as normal user, to open it in Kate.

It used to be so easy and nice before. What a pitty.

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 557
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 76 times
Been thanked: 85 times

Re: Screen-Scaling for applications running as sudo

#16 Post by wizard10000 »

The root account has its own home directory and its own configuration. The way I used to make the root account match user settings in KDE was to run systemsettings as root so configurations were written to root's home directory.

kdesu, kdesudo, gksu or gksudo systemsettings5 will get you where you want to be.
we see things not as they are, but as we are.
-- anais nin

Thomas123
Posts: 36
Joined: 2018-10-29 09:18

Re: Screen-Scaling for applications running as sudo

#17 Post by Thomas123 »

Thank you for the hint, Wizard10000,

I was originally also thinking along these lines. Makes total sense.

But trying it: kdesu, kdesudo, gksu and gksudo are all not available in Buster anymore. ... if I am not missing something.

And "sudo systemsettings5" brings strange results. Changing the font size doesn't change anything in the result. But changing "forced DPI" or "Screen-Scaling" does indeed change the result for the root applications. But the normal user applications get also changed ... way too big then.
:-(
Do have any idea?

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 557
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 76 times
Been thanked: 85 times

Re: Screen-Scaling for applications running as sudo

#18 Post by wizard10000 »

Thomas123 wrote:"sudo systemsettings5"
Don't use sudo to start graphical applications as it will overwrite configurations in your home directory with files owned by root. Unless you use 'sudo -i' the root account inherits *your* environment variables (and writes root-owned files into *your* home directory). You may find some breakage already if you ran 'sudo systemsettings5'. To fix, as root:

Code: Select all

sudo chown -R user:user /home/user
Substitute your username for "user"

kdesu is in the repos and can be installed, but for occasional use 'sudo -i' will force graphical applications to write configs to /root instead of your home directory.

Code: Select all

sudo -i
*password prompt here*
systemsettings5
Hope this helps -
we see things not as they are, but as we are.
-- anais nin

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: Screen-Scaling for applications running as sudo

#19 Post by stevepusser »

Users here have reported that the MX 19 kde-servicemenu-rootactions (which uses pkexec, BTW) works well in Buster, Bullseye, and Sid-based distros, and does allow you to run a root Dolphin:

http://mxrepo.com/mx/repo/pool/main/r/r ... rvicemenu/

It's the mx19+3 deb. We have a few other handy service menus, such as one that allows you to install any number of compatible local debs at once with apt(requires sudo), one for creating different kinds of archives, and the kim4 one for quick image processing with Imagemagick.

BTW, we had a wonderful newcomer to the MX forums yesterday. He asked questions about simple things, which is OK, but when pointed to our user manual for the answers in simple language, said he didn't want to "learn anything". He also complained about a drop-down list in a tweak applet, and when I pointed out that he had to click it to see the options, and that was common across all GUIs, including Windows, called me a condescending twat.

He got double his money back on the way out...
MX Linux packager and developer

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Screen-Scaling for applications running as sudo

#20 Post by Head_on_a_Stick »

@Steve, I loved your insults in that thread, MX should have a fortune package for stuff like that :D
deadbang

Post Reply