Running Dolphin from pkexec in Buster XFCE

Everything about X, Gnome, KDE, ... and everything running on it

Running Dolphin from pkexec in Buster XFCE

Postby NFT5 » 2019-06-16 11:21

I've been testing Buster and , so far, have found it exceptional - way better than Jessie or Stretch at the same point of development.

I've always used MATE but changed to XFCE because of continual panel crashes in Stretch, and not fixed in Buster. XFCE in Buster works just fine however I do have one problem.

I've always used Dolphin as my preferred file manager. With both MATE and XFCE in Jessie and Stretch I was able to run Dolphin as root using GKSU. This is no longer possible in Buster so I've been investigating using pkexec.

I know the oft quoted argument that GUIs should not be run as root but for simple operations I find it much faster and more convenient than the CLI, which I do use when necessary.

Some Google searching and a visit to the man pages resulted in the following, saved as /usr/share/polkit-1/actions/org.xfce.dolphin.policy
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>

 

 <vendor>Dolphin</vendor>
 <vendor_url>http://xfce.org/</vendor_url>
 <icon_name>system-file-manager</icon_name>


 <action id="org.xfce.dolphin">
 
 <description>Run Dolphin as root</description>

 <message>Authentication is required to run Dolphin as root.</message>

 <defaults>
 <allow_any>no</allow_any>
 <allow_inactive>auth_admin</allow_inactive>
 <allow_active>auth_admin</allow_active>
 </defaults>
 <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/dolphin</annotate>
 <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
 </action>

</policyconfig>


This allows Dolphin to start, using the command "pkexec dolphin", but there are no icons and I'm getting multiple errors like:
Code: Select all
QPixmap::scaled: Pixmap is a null pixmap
QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::setOpacity: Painter not active
QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::setOpacity: Painter not active
QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::setCompositionMode: Painter not active
.

The problem is not unknown. There is mention of it at:
https://forums.gentoo.org/viewtopic-t-1045362-highlight-icons+plasma.html
and also at:
https://forums.gentoo.org/viewtopic-t-1048308.html
as well as
https://bugs.kde.org/show_bug.cgi?id=344149
and
https://bbs.archlinux.org/viewtopic.php?pid=1501729#p1501729

The problem, of course, is that Gentoo is not Debian and I don't seem to have the configuration files that are mentioned in those links.

I'm kind of at a loss to know where to proceed from here. It's altogether possible I've missed something so any help on that or a fix would be appreciated.
User avatar
NFT5
 
Posts: 415
Joined: 2014-10-10 11:38
Location: Canberra, Australia

Re: Running Dolphin from pkexec in Buster XFCE

Postby Head_on_a_Stick » 2019-06-16 12:20

AFAIUI pkexec requires that the program offer a means of performing actions as root without running the GUI itself with elevated privileges, looks like Dolphin doesn't do this.

NFT5 wrote:where to proceed from here

Use the terminal for system file manipulation, running GUI file managers as root is a silly idea.

Have you tried mc or ranger? They can be run as root from a terminal (or console).
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Running Dolphin from pkexec in Buster XFCE

Postby peer » 2019-06-16 12:33

I use tux commander (tuxcmd) when I want a gui file manager as root.
peer
 
Posts: 162
Joined: 2017-03-26 10:14

Re: Running Dolphin from pkexec in Buster XFCE

Postby NFT5 » 2019-06-16 14:02

Head_on_a_Stick wrote:AFAIUI pkexec requires that the program offer a means of performing actions as root without running the GUI itself with elevated privileges, looks like Dolphin doesn't do this.


Apparently so in earlier versions, however I've seen mention that from 18.x that has been fixed. It would seem so given that it starts and runs just fine....but without icons (hence the zillions of errors).

What I'm looking for is a solution that will enable the icons.

Head_on_a_Stick wrote:Use the terminal for system file manipulation, running GUI file managers as root is a silly idea.


I knew I'd get that comment and, in a multi user environment, I'd agree completely. This machine is my desktop and no-one else uses it. I could log in as root but that would be silly....and risky, apart from the inconvenience and time involved. I'm happy to have to use my password to access the privileges since that reminds me to be careful. There are lots of minor maintenance tasks that need elevated privileges but don't involve high risk. What brought this to a head was just trying to copy a couple of image files to use on my desktop. Editing config files and similar tasks I always use nano from the CLI, but, at the end of the day, what's the difference between editing in nano or mousepad - same text, same process involved. Anyway, we can argue this at another time and place. For now I'm just looking for a solution to the missing icons issue.

@peer. Thanks, good suggestion. I can use PCManFM as well and even Thunar has the option to run as root - just no dual panes. Even Nemo can be brought in without the whole Cinnamon desktop and it, like Caja, is capable of most things. The difference with Dolphin is that from a single application I can access other computers on the LAN, other drives and even my phone. PCManFM is probably the next most capable but drives me nuts having to open the second pane and not showing expandable folders in the panes.
User avatar
NFT5
 
Posts: 415
Joined: 2014-10-10 11:38
Location: Canberra, Australia

Re: Running Dolphin from pkexec in Buster XFCE

Postby GarryRicketson » 2019-06-16 15:28

I could log in as root but that would be silly....and risky, apart from the inconvenience and time involved.

How much time does it take to just open a terminal, type 'su -' ,and your password ? Me, since I all ways have at least 1 terminal open, no time involved there, and let me see here:
Code: Select all
garry% su
Password:
garry#

Used a stop watch, 1.7 seconds, yea, your right, that is silly, and to time consuming,...in the mean time I am still waiting for a GUI to load. :mrgreen:
Last edited by GarryRicketson on 2019-06-17 00:08, edited 1 time in total.
User avatar
GarryRicketson
 
Posts: 5872
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Running Dolphin from pkexec in Buster XFCE

Postby vbrummond » 2019-06-16 22:53

Just to supply a bit of general advice..

I recently made a non-admin account on my operating system. A lot of programs I’m trying to run require root access to get them to work properly. It made me realize that it is probably the wrong thing to do and I should find alternative programs.
Always on Debian Testing
vbrummond
 
Posts: 4468
Joined: 2010-03-02 01:42

Re: Running Dolphin from pkexec in Buster XFCE

Postby stevepusser » 2019-06-16 23:09

Kde-servicemenu-rootactions modified to run dolphin as root using pkexec: http://mxrepo.com/mx/repo/pool/main/k/k ... otactions/
MX Linux packager and developer
User avatar
stevepusser
 
Posts: 12284
Joined: 2009-10-06 05:53

Re: Running Dolphin from pkexec in Buster XFCE

Postby NFT5 » 2019-06-17 07:19

Oh you got me all excited there, Steve. I thought "MX to the rescue again".

Downloaded the .deb and fired up GDebi. 95 dependencies! 95!!!! Oh well, it is still Testing, so push the button and install.

Dolphin starts with pkexec and reports........ same errors and still no icons. :(

It does show previews though. :D

Back to Google, methinks.
User avatar
NFT5
 
Posts: 415
Joined: 2014-10-10 11:38
Location: Canberra, Australia

Re: Running Dolphin from pkexec in Buster XFCE

Postby NFT5 » 2019-06-17 08:08

vbrummond wrote:A lot of programs I’m trying to run require root access to get them to work properly. It made me realize that it is probably the wrong thing to do and I should find alternative programs.


The thing is that Dolphin is a file manager and from time to time one has to access files that are outside of /home and this requires sudo or root. There is no alternative that doesn't need some kind of elevated privileges. I can run PCManFM which is similar, kind of, to Dolphin - just that I'm more comfortable with Dolphin. For PCManFM I just have to work out how to start it with dual panes........but that is the subject for another thread.

GarryRicketson wrote:in the mean time I am still waiting for a GUI to load. :mrgreen:


We're not all running XTs, mate.
User avatar
NFT5
 
Posts: 415
Joined: 2014-10-10 11:38
Location: Canberra, Australia

Re: Running Dolphin from pkexec in Buster XFCE

Postby peer » 2019-06-17 12:20

tuxcmd is dual pane
peer
 
Posts: 162
Joined: 2017-03-26 10:14

Re: Running Dolphin from pkexec in Buster XFCE

Postby stevepusser » 2019-06-17 18:11

NFT5 wrote:Oh you got me all excited there, Steve. I thought "MX to the rescue again".

Downloaded the .deb and fired up GDebi. 95 dependencies! 95!!!! Oh well, it is still Testing, so push the button and install.

Dolphin starts with pkexec and reports........ same errors and still no icons. :(

It does show previews though. :D

Back to Google, methinks.


Well, MX 19 is going to be based on Buster, and I also like to use Dolphin, so I'm going to want to fix that issue,too.

Edit: whoops, I linked to the older version without pkexec. Try this one instead: http://mxrepo.com/mx/repo/pool/main/r/r ... rvicemenu/
MX Linux packager and developer
User avatar
stevepusser
 
Posts: 12284
Joined: 2009-10-06 05:53

Re: Running Dolphin from pkexec in Buster XFCE

Postby sunrat » 2019-06-17 23:31

stevepusser wrote:Edit: whoops, I linked to the older version without pkexec. Try this one instead: http://mxrepo.com/mx/repo/pool/main/r/r ... rvicemenu/


Wow, that even works in siduction! Icons and everything. You're a magician, Stevo. 8)

I tried yesterday after reading this thread and got Dolphin to open as root by exporting DISPLAY env and xhost+, but no icons. That's a really insecure way to do it anyway so was just an exercise.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 3473
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Running Dolphin from pkexec in Buster XFCE

Postby stevepusser » 2019-06-17 23:50

Actually, it's a problem also with the Stretch version, so I ended up finding and porting over the pkexec version from this netrunner-OS PPA back then: https://launchpad.net/~netrunner-os/+ar ... 5&start=75
MX Linux packager and developer
User avatar
stevepusser
 
Posts: 12284
Joined: 2009-10-06 05:53


Return to Desktop & Multimedia

Who is online

Users browsing this forum: No registered users and 13 guests

fashionable