Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#75654 - Thunar configure custom actions as normal user

Attached to Project: Arch Linux
Opened by Vissaris (visious5d) - Friday, 19 August 2022, 17:49 GMT
Last edited by Evangelos Foutras (foutrelis) - Friday, 19 August 2022, 20:45 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Hi, I have a question for you.

I have run these two commands in terminal and working well
sudo dbus-launch mousepad /etc/pacman.conf
sudo notepadqq --allow-root /etc/pacman.conf

I have tried to add these two commands in thunar configure custom actions

thunar > Edit > Configure custom actions

Click on the + sign to open a new child window
In the tab titled: Basic
Name: Open as Root Mousepad
Description: Simple Text Editor
Command: pkexec dbus-launch mousepad %f

In the tab titled: Appearance Conditions
File Pattern: *

Appears if selection contains:
Directories : uncheck
Audio Files : uncheck
Image Files : uncheck
Text Files : check
Video Files : uncheck
Other Files : check

AND

Click on the + sign to open a new child window
In the tab titled: Basic
Name: Open as Root Notepadqq
Description: Edit source code files
Command: pkexec notepadqq --allow-root %f

In the tab titled: Appearance Conditions
File Pattern: *

Appears if selection contains:
Directories : uncheck
Audio Files : uncheck
Image Files : uncheck
Text Files : check
Video Files : uncheck
Other Files : check

And not working at all.

So I did this trick. I have opened thunar as root and added these two commands and working well.

Command: exec dbus-launch mousepad %f
And
Command: exec notepadqq --allow-root %f

Now I'm asking you. Is this a bug because I can't configure custom actions as normal user?
This task depends upon

Closed by  Evangelos Foutras (foutrelis)
Friday, 19 August 2022, 20:45 GMT
Reason for closing:  Not a bug
Comment by Evangelos Foutras (foutrelis) - Friday, 19 August 2022, 20:05 GMT
"pkexec mousepad %f" seems to work as a regular user here.
Comment by Vissaris (visious5d) - Friday, 19 August 2022, 20:18 GMT
Thank you for your tip, I have already added as custom actions. I didn't know that, what about notepadqq?
Comment by Evangelos Foutras (foutrelis) - Friday, 19 August 2022, 20:44 GMT
As far as I can see, Mousepad works because it ships /usr/share/polkit-1/actions/org.xfce.mousepad.policy.

The above policy enables "org.freedesktop.policykit.exec.allow_gui" which makes it retain the $DISPLAY and $XAUTHORITY environment variables.

I don't see an issue with Thunar's actions; if it works with pkexec from a non-root terminal, it should work as a custom command in Thunar too. For editing the odd file as root, Mousepad should suffice.

Loading...