Xfce Forum

Sub domains
 

You are not logged in.

#1 2018-04-27 16:12:52

makitso
Member
From: Tucson, Arizona, USA
Registered: 2017-05-02
Posts: 7
Website

Thunar Custom Actions

I have two custom actions, one to edit a file as root and another to open folder as root.  Each uses gksu.
The problem is that Debian has removed gksu from their repositories, which flow down to xubuntu 18.04  I have looked for an alternative way to configer a custom action but can't get it to work.  Any ideas?

gksu geany %f
gksu thunar %f

Offline

#2 2018-04-27 16:37:39

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Thunar Custom Actions

gksu's replacement is pkexec. Thunar already ships with a policy file, so the following should work:

pkexec thunar %f

Geany doesn't have a policy file so you have to create one. Create /usr/share/polkit-1/actions/org.geany.pkexec.policy with the following content:

<?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.0/policyconfig.dtd">
<policyconfig>

  <vendor>Geany</vendor>
  <vendor_url></vendor_url>
  <icon_name>geany</icon_name>

<action id="org.geany.pkexec">
   <description>Run Geany as root</description>
   <message>Authentication is required to run Geany 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/geany</annotate>
   <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
 </action>

Then:

pkexec geany %f

...should work.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2018-04-27 18:45:53

makitso
Member
From: Tucson, Arizona, USA
Registered: 2017-05-02
Posts: 7
Website

Re: Thunar Custom Actions

Bless you, that worked like a champ!!!

Offline

#4 2018-12-06 02:37:23

golinux
Member
Registered: 2011-11-19
Posts: 127

Re: Thunar Custom Actions

Hello @ToZ . . . I'm back because I'm starting to theme Xfce for Devuan Beowulf (Debian Stretch) and have come up against a wall with pkexec as described in this thread.  Generally I'm having a terrible time with graphical root access.  I could never get pkexec to launch anything in ascii either and so resorted to gksu there.  But now gksu is no longer available.  One of our devs said pkexec works when the user is in the sudo group.   Where does that leave those of us who use su?  Ever since a short stint with Ubuntu over a decade ago, I was cured of ever using sudo again so that option is not a very appealing.  LOL!  Maybe you have some creative ideas to work around this . . .

In Devuan our default is to not merge /usr so that is a factor too.

Here's a little preview of beowulf (WIP). Looks best fullscreen (white kills it).

PS.  I did install gksu from ascii and it works fine (but complains about some things in terminal and .xsession-errors.  I keep making changes and trying to get pkexec to launch but it's DOA.  I'm not feeling well so headed to bed.  Will check in when I get up.

Last edited by golinux (2019-02-18 06:23:21)

Offline

#5 2018-12-07 02:56:15

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Thunar Custom Actions

golinux wrote:

One of our devs said pkexec works when the user is in the sudo group.   Where does that leave those of us who use su?

If you're not using sudo, when prompted for a password, enter the root password.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#6 2018-12-07 17:23:11

golinux
Member
Registered: 2011-11-19
Posts: 127

Re: Thunar Custom Actions

ToZ wrote:
golinux wrote:

One of our devs said pkexec works when the user is in the sudo group.   Where does that leave those of us who use su?

If you're not using sudo, when prompted for a password, enter the root password.

I am not even getting a prompt.  Nothing is happening.  I've been under the weather.  Maybe I missed something.

Offline

#7 2018-12-07 18:07:02

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Thunar Custom Actions

golinux wrote:
ToZ wrote:
golinux wrote:

One of our devs said pkexec works when the user is in the sudo group.   Where does that leave those of us who use su?

If you're not using sudo, when prompted for a password, enter the root password.

I am not even getting a prompt.  Nothing is happening.  I've been under the weather.  Maybe I missed something.

Do you have policykit and a policykit agent running?

ps -ef | grep polkit

On ascii, it appears that polkit-1-gnome (and polkit-gnome-authentication-agent-1) are running and serving up that dialog.

How does one upgrade to Devuan Beowulf?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#8 2018-12-08 04:24:38

golinux
Member
Registered: 2011-11-19
Posts: 127

Re: Thunar Custom Actions

Here 'tis:

$ ps -ef | grep polkit
root      1908     1  0 12:44 ?        00:00:00 /usr/lib/policykit-1/polkitd --no-debug
xxxxx   14532 14525  0 21:00 pts/1    00:00:00 grep polkit

Disclaimer . . . I don't pretend to know how all this fits together.  I do know its a hairball and currently not sorted.  So this is in part troubleshooting,

Are you aware that Devuan and Debian devs are collaborating to keep init diversity in Debian with elogind and friends?   Some of that covers polkit stuff.

I installed from a mini.iso created for testing purposes.  It's a beowulf/ceres mix because new packages are moving up from unstable.  You can change you sources lines from ascii to beowulf but be sure to add ceres too.

One other thing re: catfish.  When first installed it asks to update the DB.  I click to authenticate and again nothing happens.  I think that all these failures are from the same missing part.

Offline

#9 2018-12-08 12:49:32

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Thunar Custom Actions

You don't have a policykit authentication agent running, that is why you don't have a dialog popping up. First, check if the package "policykit-1-gnome" is installed. Then make sure that it is checked in Settings Manager > Session and Startup > Autostart Applications. Then log out and back in again.

The catfish issue is the same - it needs to display the authentication box but you don't have anything running to serve up the dialog.

This is what it should look like (on ascii - I'll try the update later):

$ ps -ef | grep polkit
root      2418     1  0 02:35 ?        00:00:00 /usr/lib/policykit-1/polkitd --no-debug
toz       4725  4681  0 02:53 ?        00:00:00 /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1

Notice that the policykit dameon (polkitd) runs at the system level and the policykit authentication agent at the user level. Both need o be running to serve up the authentication dialog.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#10 2018-12-08 15:57:10

golinux
Member
Registered: 2011-11-19
Posts: 127

Re: Thunar Custom Actions

Thank you ToZ!  That was it!!  "policykit-1-gnome" was not installed but it was checked in the sessions dialog.  The custom action is now working.  However,  grep is not finding it:

$ ps -ef | grep polkit
root       1908     1  0 Dec07 ?        00:00:00 /usr/lib/policykit-1/polkitd --no-debug
XXXXX   18980 18938  0 09:35 pts/1    00:00:00 grep polkit

Wonder what that is about . . .  Maybe it needs a reboot?  Nope.  Still as above.

I just remembered that if you update as I suggested, you may get the /usr merge.  In Devuan the default is not merged and merged is a choice during an expert install.  I have no idea how that will be dealt with on an upgrade or if it is already in place.  I chose the default not to merge.  FYI, the latest mini.iso is here if you want to go that route: https://pkgmaster.devuan.org/devuan/dis … t/mini.iso The mini.iso I installed was 32 bit but this one may be amd-64 - I think it was updated.

*edit*  I asked what an upgrade would do regarding /usr and got this response: "it should work regardless of whether he has merged user or not.  The only thing he can't do is unmerge merged /usr".   Maybe make a backup before you give it a try . . .

Last edited by golinux (2018-12-08 19:48:50)

Offline

#11 2018-12-08 21:42:45

golinux
Member
Registered: 2011-11-19
Posts: 127

Re: Thunar Custom Actions

Just checked my ascii vm.  It gets it right:

$ ps -ef | grep polkit
root      2222     1  0 21:04 ?        00:00:00 /usr/lib/policykit-1/polkitd --no-debug
XXXXX   3403  2576  0 21:04 ?        00:00:00 /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1
XXXXX   3632  3622  0 21:04 pts/1    00:00:00 grep polkit

Offline

#12 2018-12-08 21:45:19

golinux
Member
Registered: 2011-11-19
Posts: 127

Re: Thunar Custom Actions

From the installer log, I think I know why policykit-1-gnome wasn't installed.  It probably needs to be "depends".

Nov 27 07:48:17 in-target: Recommended packages:  <------ THIS!
Nov 27 07:48:17 in-target:   gvfs packagekit rtkit libpam-systemd dbus-user-session xfce4-mixer synaptic
Nov 27 07:48:17 in-target:   policykit-1 libpolkit-backend-consolekit-1-0 policykit-1-gnome
Nov 27 07:48:17 in-target:   policykit-1-gnome | polkit-1-auth-agent udisks2 policykit-1 | menu
Nov 27 07:48:17 in-target:   | kde-runtime light-locker systemd-sysv | systemd-shim

Offline

#13 2018-12-08 23:18:46

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Thunar Custom Actions

What happens if your run the agent directly:

/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#14 2018-12-09 00:05:12

golinux
Member
Registered: 2011-11-19
Posts: 127

Re: Thunar Custom Actions

Now we're back to session management.  sad

$ /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1

(polkit-gnome-authentication-agent-1:4903): polkit-gnome-1-WARNING **: 18:01:44.075: Unable to determine the session we are in: No session for pid 4903

Thanks for your most excellent debugging suggestions

Last edited by golinux (2018-12-09 00:06:26)

Offline

#15 2018-12-09 00:51:44

golinux
Member
Registered: 2011-11-19
Posts: 127

Re: Thunar Custom Actions

A few posts above I was overjoyed . . .

Thank you ToZ!  That was it!!  "policykit-1-gnome" was not installed but it was checked in the sessions dialog.  The custom action is now working.

Well . . . reality check.  The custom action is NOT working.  I wasn't feeling well for a few days and had forgotten (in my fog) that I had changed the command to gksu.  So we're back to square one on pkexec.   sad

Offline

#16 2018-12-09 01:34:52

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Thunar Custom Actions

I think there is a problem with policykit on this new version. Everything works fine in ascii. I'm not sure where to create the bug report - with devuan or debian.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#17 2018-12-09 02:58:45

golinux
Member
Registered: 2011-11-19
Posts: 127

Re: Thunar Custom Actions

So you're seeing it too?  Do you have a buster installation you can test to compare?  I suspect it is in devuan's altered policykit packages but would be good to eliminate buster as a possibility.

*edit*  It would also tell us where to send the bug report.

Last edited by golinux (2018-12-09 03:18:56)

Offline

#18 2018-12-09 14:43:36

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Thunar Custom Actions

Yes. I installed beowulf using the mini iso (I used the 64-bit one) and am seeing the same error message. I have just finished installing debian buster into a VM and it does not have the same issue. So your intuition is correct - it seems to be an issue with the devuan policykit packages.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#19 2018-12-09 20:17:50

Clio
Member
Registered: 2011-01-25
Posts: 97

Re: Thunar Custom Actions

Devuan is a another Project, it is not the same as Debian.
https://bugs.devuan.org/

Offline

#20 2018-12-10 06:59:38

golinux
Member
Registered: 2011-11-19
Posts: 127

Re: Thunar Custom Actions

ToZ wrote:

Yes. I installed beowulf using the mini iso (I used the 64-bit one) and am seeing the same error message. I have just finished installing debian buster into a VM and it does not have the same issue. So your intuition is correct - it seems to be an issue with the devuan policykit packages.

Yup.  Thanks for your trouble.  It's being worked on atm. There are some needed packages in experimental but having trouble getting them to install.  The systemd dependencies are forcing a rewrite of all those packages.   I'm not used to working in a testing/unstable environment so this is a challenge for me.  I'll post when I get it sorted. In the meantime I installed gksu from ascii so I can work on the WM theme.  Not the best solution but it works . . .

Offline

#21 2018-12-10 07:08:52

golinux
Member
Registered: 2011-11-19
Posts: 127

Re: Thunar Custom Actions

Clio wrote:

Devuan is a another Project, it is not the same as Debian.
https://bugs.devuan.org/

I know.  I have been working on Devuan for 4 years. I do all the desktop theming and elsewhere too like the website and even the bugs link you posted etc.   wink  But I am lost in experimental stuff (I usually stick to stable till EOL).   Until my workflow is functional in beowulf VM I can't make much progress on the WM theme.  Xfce is the default Devuan desktop and ToZ has always been very helpful getting things sorted.

Offline

#22 2018-12-10 20:58:44

golinux
Member
Registered: 2011-11-19
Posts: 127

Re: Thunar Custom Actions

@ToZ . . . VICTORY!!  With the help of the dev who is rewriting the policykit/elogind stuff for Devuan I got it sorted.

# apt-get install libpolkit-agent-1-0=0.105-18+devuan2.3 libpolkit-backend-1-0-elogind=0.105-18+devuan2.3 libpolkit-gobject-1-0-elogind=0.105-18+devuan2.3 policykit-1=0.105-18+devuan2.3  policykit-1-gnome=0.105-7

And these sources:

deb http://pkgmaster.devuan.org/merged/ beowulf main 
deb http://pkgmaster.devuan.org/merged/ beowulf-security main 
deb http://pkgmaster.devuan.org/devuan/ experimental main 
deb http://pkgmaster.devuan.org/merged/ ceres main 

You might need to run 'pam-auth-update' + logout/in too.

It would be helpful to Devuan to give that a try to verify if you haven't nuked it.

Thunar custom actions and panel launchers now work with pkexec.  YEA!   Also the panel action buttons!!!

I'm not clear whether these pkgs will be included in Debian or only in Devuan.  I saw that some desktops are no longer working in Debian with sysvinit so this might possibly be a solution for that upstream.  I know the elogind WILL be in Buster.  Unfortunately, I don't have time or energy to follow the list where that is going on and honestly, most of it is over my head.

Now I can get on with theming the Beowulf desktop!

We knew 4 years ago that systemd userland lockin was on the horizon and it is now upon us.  Users will either get a clue or go down the chute to the monolithic abattoir . . .

Last edited by golinux (2018-12-10 21:18:59)

Offline

#23 2018-12-11 03:17:39

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Thunar Custom Actions

Cool. Thanks for the update. I'll see if I can find some time to update the system and validate this.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Board footer

Powered by FluxBB