OpenSUSE 11.4 – Run gedit as administrator

mayo 4, 2011

Today I wanted to create a desktop entry (shortcut) for my Eclipse installation. I had to create the file “/usr/share/applications/eclipse.desktop” which is located in a system directory, so I needed privileges to create such file. Since I came from Ubuntu the first thing I tried was to run the command “sudo gedit” which throwed me the error:

(gedit:9901): Gtk-WARNING **: cannot open display:

I assumed it was due to the fact that another user (root) can not access my display, so I’ve tried the command “gksudo gedit” which, to my surprise, doesn’t exist on OpenSUSE. The last thing I tried before heading to the internet was changing to root with the command “su” and then running gedit which, again throwed an error:

GLib-GIO:ERROR:gdbusconnection.c:2279:initable_init: assertion failed: (connection->initialization_error == NULL)

I was almost giving me up until I found this thread. In openSUSE you should use xdg-su instead of gksudo.
So, finally the command I ran was

xdg-su -c gedit

this worked for me!

Note: I discovered recently that you could run “gnomesu gedit” which, I think, is more easy to remember

Anuncios

Una respuesta to “OpenSUSE 11.4 – Run gedit as administrator”

  1. ag0y Says:

    nice info, i need it 🙂


Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s

A %d blogueros les gusta esto: