Cleaning user preferences, keeping user data

Dear GNOME Desktop, I appreciate my new GNOME equation t-shirt and the fact that you care about my choices and preferences. But, could you please care a bit more about what actually is important for me ?

My new tshirt

The problem : I like to keep as near-default configuration for my Gnome desktop. Every 6 months, I simply format my root partition and reinstall Ubuntu with all the packages I need (it’s even quicker than a dist-upgrade). Of course, I keep my /home partition.

And this /home partition is now a complete mess, filled with hidden .folders from every application I ever tried. Because I’ve sometimes played with experimental software, those .folders are filled with craps. Go straight for an example : I cannot use Compiz. I’ve tried to delete all related hidden folders and files, the compiz configuration is still unusable thanks to some well hidden breakage, a probable inheritance of the Beryl times. I’m not a fan of Compiz but it makes me sad to know that there’s something ugly somewhere on my computer.

Unfortunately, this problem is deeper than previously thought. Sometimes, on a fresh install I have bugs not reproducible anywhere else. Sometimes, the maintener of a package feel the need to push a new sensible default. Also, how the hell can we do a correct backup without too much overhead ?

The cause : In fact, the cause is simple. For too long, we (software developers) have happily mixed user preferences and user data.

This can even become absurd. If you carefully backup your .evolution folder, you won’t have any contacts in your address book when you will restore. You can manually check, all the informations are there, in the folder. But Evolution needs a magical-cryptic number. And this number is stored deeply inside the .gconf folder… Right, this is a reported bug but the fact that this kind of thing is even allowed to be a possibility is a breakage in itself.

A possible solution : I think that it’s time to clean a bit the desktop. There should be two kind of files in the home folder : user data and preferences. Each application developer should carefully design its application to put thing in one category or in the other.

The concept is fairly easy : if you can’t afford to loose it, it’s an user data. If a usable default exist, it’s a preference. If I restore or reinstall my desktop, I don’t mind if I must re-set my wallpaper, re-choose my favourite gnome applets,re-set the nautilus spatial mode and home-is-desktop options. But I highly care to get my files back, my songs statistics and playlists in Rhythmbox, my emails/contacts/calendars in evolution, my tomboy notes, my bookmarks, my highscores, my rss feeds and my IM contacts. Those are data ! Yes, just like my plain old files. But knowing that I have french spell checking enabled in Gedit and last.fm plugin enabled in Rhythmbox is not.

When you see that your $HOME contains folders called .gnome, .gnome2, .gnome2-private, .gconf, .gconfd, it makes sense to say that things are not so well in shape there. Not to mention applications with their own .folder but that manage to still use gconf.

Having this data/preferences duality would allow to quickly reset default preferences, to backup easily stuffs that matter. I want to be able to synchronise all my data with another computer that uses a different internet connection, a different theme, a different screen resolution.

I hope you understand what I mean, it’s not rocket science, isn’t it ? Such an improvment would be really great with my new green tshirt.

Love,

Ploum

Update : Dear beloved desktop, Fredo pointed me to the corresponding Freedesktop specification. Should I report bug against each application that doesn’t follow fd.o ?

Vote for this Ubuntu proposal

Creative Commons License
The Cleaning user preferences, keeping user data by Lionel Dricot, unless otherwise expressly stated, is licensed under a Creative Commons Attribution 2.0 Belgium License.

Show Comments Hide Comments

122 thoughts on Cleaning user preferences, keeping user data

  1. sgh says:

    Hear! Hear!
    This concept is desperately needed in every environment I’ve ever used, not just Gnome!
    We’ve come a long way, though. Remember the days of CP/M and MS/DOS, where developers assumed that their program was the only reason you bought a computer? And everything that application touched was stored in a single application-specific directory? Code, settings, and user data alike! Now we at least have a personal home directory, and are allowed to store our data in personally-specified directories according to our own concept of organization.
    Several times, I’ve been reduced to copying my ~/, and deleting all .hidden files and directories in order to make a clean install really clean, but then its TOO clean. I like your distinction of ‘if there’s a usable default…’ That would make merging my preferences and settings into a new clean install much easier.

  2. gus says:

    Totally agree, the actual preference schema is a mess. I suffer from exactly the same disease every 6 months.

  3. Arthur says:

    Ah, yes, that would be a very nice initiative. One would have to look at all packages in *buntu, not just the Gnome ones. And don’t fool yourself: There will be corner cases which are almost rocket science and even some which will be undecidable. But it does have to be done. Let’s get working…

  4. san says:

    in KDE, they store preferences in .kde/share/config
    and data in .kde/share/apps.

    Not sure however what happens if the whole config directory is deleted.

  5. Piotr says:

    ***Yes*** you are so completely right (ok, in my case that would be rather KDE, but still…)

  6. Graham says:

    My usual approach when upgrading is to dump every .* folder in a config-backup folder in ~/. Then I copy out stuff as I find a need for it, eventually dumping everything else once I’m sure I don’t need it any more.

    Of course, that’s a workaround, not a fix, and I agree wholeheartedly: this shouldn’t be as complicated and irritating as it undoubtedly is.

  7. Have a look at how BeOS did it back in the day, all preferences went into ~/config/, leaving the rest of ~ for user data

  8. Fredo says:

    The freedesktop group has defined such a directory structure that should be used across desktops: http://www.freedesktop.org/wiki/...

    The default for $XDG_CONFIG_HOME is $HOME/.config, the default for $XDG_DATA_HOME is $HOME/.local/share. So all applications should look for those environment variables and use those default vaulues if the variables are not set.

    More and more applications start using these, but I think the majority still doesn’t – including GNOME itself.

  9. Ploum says:

    Fredo > that’s really great and what I was hopping for ! So, now, it’s just a matter of reporting bugs against all applications that don’t use this standard :-)

  10. dave says:

    Mac OS X has a feature that might help sell the transition to the developers. In Mac OS X if a program crashes, then crashes again immediately on restart, it offers to open it again without any preferences. If it works then it a) lets you into the program which you would otherwise be locked out of, and b) gives you somewhere to start looking for the problem.

  11. k1000 says:

    Salut Lio.
    Parfaitement d’accord avec toi. Je n’ose pas activer l’affichage des fichiers cachés dans nautilus de peur d’être inondé et ne pas retrouver mes propres fichiers.
    Je crois que cet article récent va dans le même sens : http://www.codinghorror.com/blog...

  12. Geoff says:

    I completely agree with the sentiments in this posting.

    A folder like the ~/Library/Preferences/ folder in Mac OSX would be a great step forward, enabling configuration preferences to be sanely organised per application and easily located and cleaned.

  13. kezar says:

    Suivant ton gestionnaire de paquets il est possible de nettoyer tes préférences à la suppression du programme. Cette option n’est pas choisie par défaut puisque la plupart des utilisateurs souhaitent pouvoir retrouver leurs données à la réinstallation du programme.

    Exemple sur archlinux :
    pacman -Rn [paquet]
    ou yaourt -Rn [paquet]
    Sur les debian-like :
    apt-get –purge remove [paquet]

    Pour la séparation config/données, je ne sais pas trop comment envisager ça, les deux sont souvent mêlées (pour evolution oui c’est le bordel, ya de quoi y bosser ça c’est sûr).

  14. Ploum says:

    Kezar > le gestionnaire de paquet ne touche jamais les répertoires utilisateurs (et c’est heureux). Cette option purge seulement le répertoire /etc/.

  15. kezar says:

    Passé un temps il me le faisait (enfin j’ai donné l’exemple debian sans y avoir touché depuis des lustres, ce n’est sûrement pas le cas effectivement).

    Pour ton problème de compiz il ya des deps dans .config/compiz et .emerald (si tu utilisais emerald). À priori c’est tout.

    Personnellement je fais des réinstallations régulièrement et des migrations de configuration à l’occasion et j’arrive à m’y retrouver sans trop de problèmes, je sais ce qui sert et ce qui ne sert pas. Le plus simple reste encore de ne pas utiliser son compte de travail pour faire des tests, et d’en faire un autre qu’on peut réinitialiser au besoin (j’ai suivi les dev de kde4 comme ça). Bien sûr ce n’est pas l’idéal, et on pourrait penser à séparer la configuration des données. D’un autre côté ça complexifie un peu les migrations, il faut aller piocher dans le répertoire de config ce qu’on veut prendre en plus des répertoires de données. Pour un navigateur typiquement la configuration serait séparée des données : comment gérer les plugins ? Ce sont des données mais ils ont besoin de configuration spécifique pour fonctionner. Si on perd la configuration, les données seront-elles toujours exploitables ? Que fait-on des plugins orphelins ? Le cache est défini dans la configuration. Si on change la valeur par défaut, qu’on perd la config et qu’on relance le navigateur, qu’en est-il du cache excédentaire ? Si le navigateur gère les mails (comme Opera par exemple), la configuration des comptes mail va dans la config, mais les mails en eux même dans les données. On perd la config, comment traite-t-on les données ? Il y a beaucoup d’effets de bord potentiels, et de quoi débattre un moment :)

  16. antistress says:

    très interessant, merci à Ploum et Fredo

    de manière un peu connexe, il y a quelques efforts d’uniformisation à faire dans GNOME en termes d’interfaces

    exemples :

    * Unifying name for Plugins/Extensions/etc.
    mail.gnome.org/archives/d…

    * la présentation des menus :
    – les "plugins" sont dans Edition>Préférences de EoG ou Gedit vs dans Editions>Plugins de Totem ou Rhythmbox vs dans Tools>Extensions d’Epiphany vs Edit>Manage Extensions de F-Spot…
    – la configuration des barres d’icônes se fait par Edit>Toolbar dans EoG et Evince vs View>toolbars>customize toolbars dans Epiphany…

  17. Gnome Desktop says:

    Dear Ploum,

    After having read carefully your RFI (Request For Improvement), I came to the conclusion that you would be much more happy with a Windows desktop.

    Indeed, as every Windows user will tell you, in the "My Documents" folder, there are, among other things, 2 hidden directories
    "C:\Documents and Settings\UserX\Application Data" and "C:\Documents and Settings\UserX\UserData" that have been created there just for the purpose of separating the user data (notice the absence of space in the name, for ease of backing it up) and the applications settings/preferences.
    Further more, reinstalling one’s machine every 6 month is a requirement to which every Windows user happily complies to so you shouldn’t have too much problem to get accustomed to this wonderful desktop environment full of surprises !
    :-p

    Yours sincerely,
    Gnome Desktop.

  18. antistress says:

    NEWS: totem-2.21.94:
    Note that configuration files are now in ~/.config/totem/ instead
    of ~/.gnome2/Totem. You will need to move the files by hand

  19. J’aime bien cette idée. Peut-être que tu pourrais la mettre sur brainstorm.ubuntu.com/ pour lui donner plus de visibilité ?

  20. antistress says:

    Yann Dinendal : ça ne me semble pas une bonne idée, car il n’y a pas de brainstorm à ce sujet : il a déjà été fait par Free Desktop qui a émis une recommandation (commentaire 8)
    Ce qu’il reste à faire, c’est remplir des rapports de bogue contre les logiciels qui ne s’y conforment pas encore

  21. antistress says:

    Bug 520103 – Gnome-schedule doesn’t match FreeDesktop directories specs
    bugzilla.gnome.org/show_b…

  22. antistress says:

    Gnome Do doesn’t match FreeDesktop directories specs
    bugs.launchpad.net/do/+bu…

  23. antistress says:

    Bug 520398 – Brasero doesn’t match FreeDesktop directories specs
    bugzilla.gnome.org/show_b…

  24. antistress says:

    Bug 521488 – F-Spot doesn’t match FreeDesktop directories specs
    bugzilla.gnome.org/show_b…

  25. antistress says:

    Bug 259356 – Firefox support for the Freedesktop.org XDG variables
    bugzilla.mozilla.org/show…

  26. antistress says:

    Parcellite doesn’t match FreeDesktop directories specs
    code.google.com/p/xyhthyx…

  27. Ploum says:

    ça commence à porter ses fruits ! Le nouveau Totem respecte les spec :-)

  28. antistress says:

    FS#375 – Avidemux doesn’t match FreeDesktop directories specs
    bugs.avidemux.org/index.p…

  29. Ploum says:

    Gweled : bugs.edge.launchpad.net/u…

    But I also commited the patch ;-)

  30. antistress says:

    Bug 522619 – Totem doesn’t match entirely FreeDesktop directories specs (playlist backuped file should be in $XDG_DATA_HOME)
    bugzilla.gnome.org/show_b…

    comment ça je chipote ?!

  31. antistress says:

    Bug 518589 – Rhythmbox does not adhere to freedesktop.org’s XDG Base Directory Specification
    bugzilla.gnome.org/show_b…

  32. antistress says:

    Bug 522806 – Eye of GNOME doesn’t match FreeDesktop directories specs
    bugzilla.gnome.org/show_b…

    Bug 522810 – Epiphany doesn’t match FreeDesktop directories specs
    bugzilla.gnome.org/show_b…

    Bug 522811 – Evince doesn’t match FreeDesktop directories specs
    bugzilla.gnome.org/show_b…

    Bug 522812 – File Roller doesn’t match FreeDesktop directories specs
    bugzilla.gnome.org/show_b…

    Bug 522813 – Deskbar Applet doesn’t match FreeDesktop directories specs
    bugzilla.gnome.org/show_b…

    Bug 522817 – GNOME Dictionary doesn’t match FreeDesktop directories specs
    bugzilla.gnome.org/show_b…

  33. antistress says:

    Bug 522844 – Nautilus doesn’t match FreeDesktop directories specs (nautilus-scripts directory should not be ~/.gnome2/nautilus-scripts)
    bugzilla.gnome.org/show_b…

    Bug 522845 – Panel doesn’t match FreeDesktop directories specs
    bugzilla.gnome.org/show_b…

    Bug 522849 – Yelp doesn’t match FreeDesktop directories specs
    bugzilla.gnome.org/show_b…

    Bug 522848 – Gedit doesn’t match FreeDesktop directories specs
    bugzilla.gnome.org/show_b…

    Bug 522851 – Seahorse doesn’t match FreeDesktop directories specs
    bugzilla.gnome.org/show_b…

    Bug 522853 – gnome-pilot doesn’t match FreeDesktop directories specs
    bugzilla.gnome.org/show_b…

  34. antistress says:

    [ 1905548 ] Comix Directory structure doesn’t match the freedesktop specs
    sourceforge.net/tracker/i…

    Bug 523038 – Evolution doesn’t match FreeDesktop directories specs
    bugzilla.gnome.org/show_b…

    Bug 166643 – Support for the Freedesktop.org XDG variables in The GIMP
    bugzilla.gnome.org/show_b…

  35. antistress says:

    Ticket #797 Transmission doesn’t match FreeDesktop basedir-spec
    trac.transmissionbt.com/t…

    A noter, concernant les applications dépendant de GNOME/bugzilla :
    Bug 523057 – [Tracking bug:] Match FreeDesktop directory specs
    bugzilla.gnome.org/show_b…

  36. Ploum says:

    Deluge doesn’t comply perfectly : dev.deluge-torrent.org/ti…

  37. antistress says:

    fricorder doesn’t match FreeDesktop directories specs
    code.google.com/p/fricord…

  38. antistress says:

    Ploum made this proposed Gnome Goal :
    live.gnome.org/GnomeGoals…

  39. antistress says:

    Parcellite v0.7 Sunday, March 30 2008
    Changes
    + Config now saves in ~/.config/parcellite following freedesktop.org specifications.
    + Data now saves in ~/.local/share/parcellite following freedesktop.org specifications

  40. antistress says:

    Transmission 1.20 uses XDG basedir spec for configuration files

  41. antistress says:

    GNOME Do 0.5 now matches FreeDesktop directories specs

  42. antistress says:

    "VLC 0.9 now complies with the XDG Base Directory Specification version 0.6
    standards.freedesktop.org…
    (which means that VLC doesn’t use the $HOME/.vlc directory anymore)"
    forum.videolan.org/viewto…

  43. antistress says:

    TakeNote 0.4.4 has XDG configuration support
    rasm.ods.org/takenote/ind…

  44. antistress says:

    tiens Midori (le navigateur WebKit+GTK+2) supporte la XDG Base Directory Specification de Freedesktop aussi
    http://www.twotoasts.de/index.ph...

  45. antistress says:

    pyRenamer doesn’t match FreeDesktop directories specs
    bugs.launchpad.net/bugs/3…

  46. antistress says:

    jBrout doesn’t match FreeDesktop directories specs
    code.google.com/p/jbrout/…

  47. antistress says:

    Bug 518589 is fixed (Rhythmbox does not adhere to freedesktop.org’s XDG Base Directory Specification)
    bugzilla.gnome.org/show_b…

  48. antistress says:

    Issue 138: Quod Libet doesn’t match FreeDesktop directories specs
    code.google.com/p/quodlib…

  49. antistress says:

    fontconfig doesn’t match FreeDesktop directories specs
    bugs.freedesktop.org/show…

  50. antistress says:

    gconf doesn’t match FreeDesktop directories specs
    bugzilla.gnome.org/show_b…

  51. antistress says:

    gstreamer doesn’t match FreeDesktop directories specs
    bugzilla.gnome.org/show_b…

  52. antistress says:

    Comix 4.0.3 – 2009-02-22
    $XDG_CONFIG_HOME and $XDG_DATA_HOME directories instead of in ~/.comix/.
    comix.sourceforge.net/cha…

  53. antistress says:

    C’est du bon boulot pour comix : lorsqu’on installe la 4.0.3 au dessus d’une ancienne version, il copie les fichiers existants dans les dossiers $XDG qui vont bien, puis au 1er démarrage une fenêtre popup demande à l’utilisateur s’il veut nettoyer les anciens fichiers ce qui est recommandé sauf si l’utilisateur prévoit de revenir à une version précédente

  54. frozen says:

    If you need to cleen your ~ (home) folder, you can enter something like:
    find ~ -maxdepth 1 -iname ‘.*’ -atime +60 > files_to_remove
    to find all hidden files and folders that have not been accessed for more than 60 days (unless you have noatime in /etc/fstab), and save them to ‘files_to_remove’, edit that file to remove the entries you know you need and then enter:
    rm -rf $(<files_to_remove)
    to delete them.

  55. antistress says:

    phraymd doesn’t match FreeDesktop directories specs
    bugs.launchpad.net/phraym…

  56. antistress says:

    Enchant 1.4.2 makes use of XDG’s data-dirs spec for locating dictionaries http://www.abisource.com/project...

  57. antistress says:

    phraymd now does match FreeDesktop directories specs (lp:phraymd rev. 203)