Sudo issue since porting to Endeavour (minor issue)

Under Manjaro, I was able to open a terminal, and issue:
"sudo mousepad " and then edit it.

Now I am getting this error when attempting to do the same:
"[dcbdbis@Curly-Sr ~]$ sudo mousepad
Failed to initialize xfconf[dcbdbis@Curly-Sr ~]$ "

I can easily get around this by: "sudo dbus-launch mousepad " But it is extra typing - and
MeaCulpa, I’m lazy.

I am sure there is a setting somewhere…but I am NOT getting much at all with google or DuckDuckGo searches…Other than “Don’t do it”. I am in a sole office, in my home. I am not that worried about physical intruders…I would prefer the convenience - if possible.

How to I get Endeavour to allow sudo’s for GUI’s (works fine for CLI apps)…OR do I have to create my own command by aliasing the “sudo dbus-launch” string?

Thanks!

Sincerely and Respectfully,

Dave

Edits: I alias’d it. But the question still stands what’s different in my shell config before and after…So I have some ignorance that needs to be banished…:slight_smile:

The reason you shouldn’t be using sudo with GUI programs like mousepad is not that there are might be intruders in your home to take advantage of that, but because running them with sudo can mess up ownership of files and directories inside your home directory and cause breakage of other programs, because that’s where GUI programs often store settings.

5 Likes

I still have a box running Manjaro and

has the same result on it and has done for some time.

2 Likes

I recommend using xed - a great editor - supporting gvfs and as such you can launch the editor from cli e.g.

xed admin://etc/fstab

but it is equally easy create thunar custom action for editing as root.

1 Like

Other editing options that handle sudo OK that come to mind…

  1. featherpad
  2. leafpad
  3. micro
  4. nano

This is in addition to xed - which is a good choice too.

Kate uses polkit, so it does not need sudo.

3 Likes

Sublime text 3 too, but you know, not very FOSS… :upside_down_face:

Forgot about her :grin: Good point - it now will ask for password when permission needed, correct?

2 Likes

Thank you for your solution. My age, and my old habits are in view!

I didn’t know that using sudo or su was affected by any particular app. And I have used xed in the past, and it has worked fine. So I simply switched to xed, and I’ll delete my alias I created yesterday.

Thank you again!

Dave

Edit: PS: I appreciate learning that the sudo/su thing is app specific, not “X” specific. So another little piece of knowledge gained, and some ignorance banished!

I am aware of the implication of using sudo with GUI’s. After 16 years my paradigm hasn’t caused me any issues. I’m not saying there are not issues - I am saying that I’m pretty careful when I deploy it.

Micro is amazing, in the config file set:

    "autosu": true,
    "sucmd": "sudo",

Then edit any file that requires sudo it will prompt you to enter your password:
image

3 Likes

for mousepad i had a mpad script with dbus-launch in /usr/share , and a alias rootpad :slight_smile:

but mainreason is, arch had a update some package splitted out dbus ; and manjaro just simple dbus with that patch, its in aur, dbus-x11 and would not touch that :slight_smile:

probably done for a reason… but manjaro just put it back in, arch uses dbus while manjaro dbus-x11

I never do it that way, if I do GUI text editor I just right click on the directory and chose “open as root”. Then edit the file and the text editor will automatically be able to edit and save the file.

@Beardedgeek72

Thank you for your response…

That sounds like a Thunar custom action. Different distro’s come with different custom actions installed in Thunar.

I already do that in my copy of Thunar…with some other custom actions I’ve created. But as an older guy, who cut his teeth at the terminal, on a 300 baud acoustically coupled modem, and with assembly language …I use the cli a LOT. Sometimes I find it quicker to use the terminal than I do a GUI.

Yes, yes…old habits die hard…

Ahh - it’s all good though. We all have different approaches to our workflow, and it’s very good to share them. I’ve picked up a lot of tricks from folks more experienced than me along the way.

Dave

Edit: Correction: Teletype instead of terminal. Terminals weren’t around then. And programming was done with green punch cards.

2 Likes

What, you had color? Get off my lawn :wink:

(Nah, I’m not that old, I’m 48. No punch cards).

1 Like