You are not logged in.

#1 2011-06-21 19:20:28

Pacopag
Member
Registered: 2011-05-29
Posts: 287

[SOLVED] sudo and geany

Hi.  I can't seem to run "sudo geany /path/to/a/file".  It gives me a message

No protocol specified
Geany: cannot open display

Actually, I get a message to this effect with any command like "sudo launchsomeguiapp"

If I run (which I found in another thread)

xhost
xhost +localhost

then it works fine.  I'm wondering where to put these commands so that they run automatically on startup (is this a bad idea?  e.g. rc.sysinit ?), or if there is some other way to get sudo to launch guis.

Last edited by Pacopag (2011-06-27 16:14:53)

Offline

#2 2011-06-21 20:06:14

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,842
Website

Re: [SOLVED] sudo and geany

You shouldn't use sudo for graphical apps, not unless you want to risk messing up the permissions on your config files + .Xauthority file. Use gksu, gksudo, kdesudo, su -, etc. where possible.

Last edited by WorMzy (2011-06-21 20:06:38)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2011-06-21 20:30:43

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: [SOLVED] sudo and geany

I've been using sudo for graphical apps since forever. And I've never needed the xhost trick (which I've read is not a good thing to do, but I don't know details). In fact, I just found out I don't even have xhost!

Offline

#4 2011-06-21 22:52:21

Stebalien
Member
Registered: 2010-04-27
Posts: 1,237
Website

Re: [SOLVED] sudo and geany

Try adding/uncommenting the following in your sudoers file.

Defaults env_keep += "XDG_SESSION_COOKIE XAUTHORITY"

Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

#5 2011-06-27 16:13:13

Pacopag
Member
Registered: 2011-05-29
Posts: 287

Re: [SOLVED] sudo and geany

Thanks for your replies.  I installed gksu and gksudo works great.

Offline

Board footer

Powered by FluxBB