[Bug 796076] Re: When run as root [gksudo gedit whatever] gedit tries to open a 2nd 'untitled document 1'

2012-11-11 Thread Freecore
Temporary SOLUTION:

I've found another workaround. Unfortunately for us this doesn't seems
to be a bug, at least I guess there's no intention from gnome developers
to solve it soon:

A upstream developer said: You shouldn't start GNOME programmes with
elevated privileges, it's not supported. In any case, not a gnome-
terminal bug. It's not just nautilus it's any gnome application with a
GUI.

This can be confirmed according to the upstream of the Nautilus bug,
https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/805682, at Gnome
bugzilla (https://bugzilla.gnome.org/show_bug.cgi?id=654184). It's clear
that Gnome developers don't design their programs to be runned as root.

So, since they don't want to support gnome graphical programs as root, it's not 
a bug. If you can read more about why they don't support this you can read:
- http://ubuntuforums.org/showthread.php?t=2014450
- https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1019995


But it IS a problem if we want to start gnome graphical programs as root. So we 
need alternative solutions:

- Paddy Landau have created a workaround for it (comment #20) and posted it at 
http://ubuntuforums.org/showpost.php?p=12071894postcount=81.
- You can use alternative applications (like graphical leafpad or vim and nando 
in the terminal).
- Running sudo gedit (NOT recommended, graphical programs should be runned with 
gksudo or kdesudo)
- The simplest solution I got. (See down).


As Derek White posted in
https://bugs.launchpad.net/ubuntu/+source/gedit/+bug/890041.

$ gedit # opens untitled document
$ gedit /path/to/file # opens file
$ sudo gedit /path/to/file # opens file
$ gksu gedit /path/to/file # opens file  untitled document
$ gksudo gedit /path/to/file # opens file  untitled document

I figured out that it only happens when you try to gksudo with other
user. For example:

$ gksudo -u userA /path/to/file # Will opens file normally if logged as userA.
$ gksudo /path/to/file # Will also opens normally if you're logged as root 
(with sudo -i or something).

But if you are root and try to gksudo with other user it will brings the
untitled document again:

$ gksudo -u UserA /path/to/file # Will opens file  untitled document.

So, as long as we are supossed to run graphical applications with
gksudo, the solution is to be logged as root and run gedit with gksudo
(whitout parameters it'll run as root). If you want to do this in one
single line you can do:

$ sudo gksudo gedit /path/to/file # Works perfectly.
$ gksudo gksudo gedit /path/to/file # Works perfectly. I recomend this, 
specially if you want to call gedit in a script or something.

That's it!

I wish this can help to devs to deciding fix this problem an support
graphical as root. Or someone else to add the feature to Gnome
applications.

** Bug watch added: GNOME Bug Tracker #654184
   https://bugzilla.gnome.org/show_bug.cgi?id=654184

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/796076

Title:
  When run as root [gksudo gedit whatever]  gedit  tries to open a 2nd
  'untitled document 1'

To manage notifications about this bug go to:
https://bugs.launchpad.net/gedit/+bug/796076/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 934047] Re: Double wallpaper-entries in appearance menu

2012-11-06 Thread Freecore
I found THE solution!

(thanks to Ali for his information in comment #10)

I had the same problem.

It appears to be that Ubuntu seeks for XML entrys in ALL the files in
/usr/share/gnome-backgroud-properties directory, not only the xml files
(you can even have a file named my-wallpapers.ogg but filled as XML with
your pictures entrys and it will work). So it is not necesary to add the
entrys in precise-wallpapers.xml file or in ubuntu-wallpapers.xml file,
you can have your own file like my-wallpapers.xml.

- Now, why the pictures appears twice in the appearance menue?

It's because text editors like gedit creates backup files for every file
you are changing (for my-wallpapers.xml it will create my-
wallpapers.xml~). All you have to do is to remove all the backup files
and you will have the appearance menu just like you wanted it.

PD: Text editors backup files are hidden by default, because of that one
can no realize why the pictures appears twice. you can remove the backup
files with sudo rm, or you can run nautilus as root and hit the view
hidden files option.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/934047

Title:
  Double wallpaper-entries in appearance menu

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/934047/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs