Xed is not working with pkexec

I tried to add a custom action on Thunar based on the XFCE docs and specifically “Edit file as root”. I followed the tutorial and added this in the custom action: pkexec xed %f, but nothing showed up when I ran it. I tested it with another file using the same command on the terminal and here’s the output:

[rapta@endeavour ~]$ pkexec xed $HOME/Documents/scripts/test.sh

(xed:7072): Gtk-WARNING **: 18:14:41.143: cannot open display: 

Using sudo did work, but with sudo the notification doesn’t pop up and I can’t type my password, making it useless. I made another custom action with pkexec too (Open Thunar as root) which does work. Is it fixable?

Try mousepad.

pkexec mousepad works for me.

I get the same output as yours with pkexec xed.

For security reasons it is recommended to avoid running GUI stuff as root.
A better approach is to use e.g. nano or another non-GUI editor.

Another question is why do you need to edit the files at your $HOME as root?


xed admin:///etc/fstab

should work :slight_smile:
answer should be around here


As xed admin;//%f should do


It was an example

Doesn’t seem to work…

I replaced xed with mousepad and it works, thanks!

1 Like

sidenote the ; did the wrong

xed admin://%f

should work :slight_smile: no pkexec needed

Also please have a read here to know the security implications of running a GUI application as root:



I am aware of the possible consequences, I use this function rarely and only when needed.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.