bugGKSu - Bugs: bug #37872, Support XDG basedir specification


bug #37872: Support XDG basedir specification

Submitted by:  Eric Heintzmann <eheintzmann>
Submitted on:  Wed 05 Dec 2012 09:36:27 PM UTC  
Votes:  1  
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Sat 08 Mar 2014 11:39:34 AM UTC, comment #2:

### The XDG spec has grown and includes environmental parameters related to desktop sessions and so on.

For example, $XDG_RUNTIME_DIR

I frequently want to run gksu with the -u switch : gksu -u lesser [commands]
(Instead of running gksu without a -u switch, thus defaulting to running as root).

Here is a (non-representative, but specific to my machine) sample:

XDG_CONFIG_HOME is /root/.config
XDG_DATA_DIRS is /usr/local/share/:/usr/share/:/usr/share/mdm/
XDG_DATA_HOME is ~/.local/share
XDG_RUNTIME_DIR is /run/user/0
XDG_SEAT is seat0
XDG_SESSION_COOKIE is d012284f9cacbc963a4b500900000a23-1393081962.511687-1819563469

In particular, gksu should **not** be passing "XDG_RUNTIME_DIR" into the gksu user's environment!

See a script that modifies the XDG_* variables in the environment using env as the command parameter to gksu , then runs the finally wanted command using this new env, at http://pastie.org/8898241. After running vim from gksu with this script as a setup.

The errors that are reported when the XDG* environment are not cleaned up depend on the application that's being run. **XDG_RUNTIME_DIR** is the most likely troublemaker.

Sören Andersen <somian>
Sat 05 Jan 2013 10:15:34 AM UTC, comment #1:

According to XDG Base directory specification:
User data should go into $XDG_DATA_HOME (which default to ~/.local/share),
user preferences should go into $XDG_CONFIG_HOME (which default to ~/.config)
and cached data should go to $XDG_CACHE_HOME (which default to ~/.cache).
More details at :

Full specification can be found at:

The Freedesktop.org XDG base directory specification have good de facto adoption.
It has been adopted by:
- GNOME ( https://live.gnome.org/GnomeGoals/XDGConfigFolders )
- GTK+ ( https://bugzilla.gnome.org/show_bug.cgi?id=646631 )
- KDE ( http://techbase.kde.org/KDE_System_Administration/XDG_Filesystem_Hierarchy#Freedesktop.org_and_Standard_Directories )
- QT ( http://harmattan-dev.nokia.com/docs/library/html/qt4/qsettings.html#setPath )
- XFCE ( http://docs.xfce.org/xfce/xfce4-session/advanced in Files and Environment Variables )
- Razor-qt
- VLC ( https://trac.videolan.org/vlc/ticket/1267 )
- GStreamer ( https://bugzilla.gnome.org/show_bug.cgi?id=518597 )
- Chrome ( http://code.google.com/p/chromium/issues/detail?id=16976 )
- many more upstream applications
- Ubuntu ( http://brainstorm.ubuntu.com/idea/6557/ & http://packages.ubuntu.com/fr/source/precise/libxdg-basedir )
- Debian ( http://packages.debian.org/squeeze/libxdg-basedir1 )
- Red Hat
- Fedora
- Suse
- many more distributions

I think that GKSu should use same locations than the vast majority of Desktop environment and applications.

There are real advantages of following this specification :
- a lot less cluttered $HOME
- Make backups a lot more safer and easier.
Backuping your $XDG_DATA_HOME along with your files is enough
(or just excluding $XDG_CACHE_HOME)
- A lot easier to reset a default configuration if you want/need it (and
without any risk to loose informations). Even for the software itself
could choose to reset $XDG_CONFIG_HOME if needed.
- Avoid some strange bugs that happens because you had a old version of
some configuration file
- A lot more of flexibility and portability because no path are hardcoded.

Eric Heintzmann <eheintzmann>
Wed 05 Dec 2012 09:36:27 PM UTC, original submission:

Please support FreeDesktop.org XDG basedir specification for gksu


Eric Heintzmann <eheintzmann>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by somian (Posted a comment)
  • -email is unavailable- added by somian (Voted in favor of this item)
  • -email is unavailable- added by eheintzmann (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 1 encouragement so far.

    Only logged-in users can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-03-08 somian Carbon-Copy- => Added somian

    Back to the top

    Powered by Savane 3.3