Screen-Scaling for applications running as sudo

If none of the more specific forums is the right place to ask

Screen-Scaling for applications running as sudo

Postby Thomas123 » 2019-08-05 15:58

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?
Thomas123
 
Posts: 36
Joined: 2018-10-29 09:18

Re: Screen-Scaling for applications running as sudo

Postby phenest » 2019-08-05 16:36

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
User avatar
phenest
 
Posts: 1704
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Screen-Scaling for applications running as sudo

Postby Thomas123 » 2019-08-05 18:35

Yes, particularly: sudo thunar
Thomas123
 
Posts: 36
Joined: 2018-10-29 09:18

Re: Screen-Scaling for applications running as sudo

Postby phenest » 2019-08-05 18:43

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
User avatar
phenest
 
Posts: 1704
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Screen-Scaling for applications running as sudo

Postby Thomas123 » 2019-08-05 18:50

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?
Thomas123
 
Posts: 36
Joined: 2018-10-29 09:18

Re: Screen-Scaling for applications running as sudo

Postby phenest » 2019-08-05 18:58

ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D
User avatar
phenest
 
Posts: 1704
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Screen-Scaling for applications running as sudo

Postby Head_on_a_Stick » 2019-08-05 19:57

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.
User avatar
Head_on_a_Stick
 
Posts: 10517
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Screen-Scaling for applications running as sudo

Postby phenest » 2019-08-05 20:08

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
phenest
 
Posts: 1704
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Screen-Scaling for applications running as sudo

Postby Head_on_a_Stick » 2019-08-05 20:10

Oh really? In which case thanks for the correction and sorry for the noise :oops:
User avatar
Head_on_a_Stick
 
Posts: 10517
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Screen-Scaling for applications running as sudo

Postby phenest » 2019-08-05 20:44

And thank you for the handy tip.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D
User avatar
phenest
 
Posts: 1704
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Screen-Scaling for applications running as sudo

Postby Thomas123 » 2019-08-06 06:29

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?
Thomas123
 
Posts: 36
Joined: 2018-10-29 09:18

Re: Screen-Scaling for applications running as sudo

Postby Head_on_a_Stick » 2019-08-06 07:40

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.
User avatar
Head_on_a_Stick
 
Posts: 10517
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Screen-Scaling for applications running as sudo

Postby Thomas123 » 2019-08-06 09:55

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!
Thomas123
 
Posts: 36
Joined: 2018-10-29 09:18

Re: Screen-Scaling for applications running as sudo

Postby Head_on_a_Stick » 2019-08-06 10:06

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.
User avatar
Head_on_a_Stick
 
Posts: 10517
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Screen-Scaling for applications running as sudo

Postby Thomas123 » 2019-08-06 10:11

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.
Thomas123
 
Posts: 36
Joined: 2018-10-29 09:18

Next

Return to General Questions

Who is online

Users browsing this forum: alma359 and 15 guests

fashionable