GNOME Bugzilla – Bug 627939
GDM XDG config folder implementation
Last modified: 2013-07-25 19:30:37 UTC
See http://live.gnome.org/GnomeGoals/XDGConfigFolders GDM currently dumps some files in the user's home directory, which should be moved according to the XDG base directory specification: ~/.dmrc -> $XDG_CONFIG_HOME/gdm/dmrc ~/.xsession-errors -> $XDG_CACHE_HOME/gdm/xsession-errors ~/.xsession-errors.old -> $XDG_CACHE_HOME/gdm/xsession-errors.old Will be back with a patch soonish.
Created attachment 168745 [details] [review] Change function prototypes to make distrinction between folders clearer
Created attachment 168746 [details] [review] get config_dir and cache_dir and use them
Created attachment 168747 [details] [review] Update GDM's cache from the right location TO DO - migrate files - update documentation concerning ~/.face
Just a random thought: aren't .xsession-errors and .dmrc supposed to be shared between gdm/xdm/kdm? If that is the case, .dmrc should go to $XDG_CONFIG_HOME/dmrc and .xsession-errors to $XDG_CACHE_HOME/xsession-errors (or better .local/var/log/xsession-errors or /var/run/user/log/xsession-errors)
I confirm that dmrc is shared by gdm/xdm/kdm, so comment #4 makes perfect sense. However is poses problems regarding migration. Moving .dmrc only in gdm would render GNOME incompatible with the other session managers. However, since changing the session manager is not common, would this really be a problem? Comments appreciated.
Christan, this is what comes to my mind right now: Option 1: Maybe we could bring this up on the KDE/XORG/etc. mailing lists, and how the response is there, maybe we can get fixes into each wm simultaniosly? Option 2: Move the config files and create sym links in $HOME, then after some transition time, we remove the symlinks Cheers Sebastian
A common settings store is being drafted in FDo [1], but it seems to advance slowly. Too bad, it would have been the perfect replacement for dmrc. :( [1] http://www.freedesktop.org/wiki/Specifications/config-spec
i'd to see this change, too. but .dmrc should be in $XDG_CONFIG_HOME, rename to dm.rc ro dm.conf .xsession-errors should be in $XDG_CACHE_HOME, rename to xsession.log or something else. .xsession-errors should not be placed in /var/log, cuz user should not have promission to change any place except there $HOME dir. and this change don't need create symlinks, because very few users change them by editing the config file.
Seems this patch is not actually work... there will be no xsession-errors every where. and my terminals start in / . maybe because g_get_user_config_dir cannot get user name?
it won't be that easy. the earliest place user can define $XDG_CONFIG_HOME is ~/.profile or ~/.xprofile. but gdm won't read this file when save dmrc or creat .xsession-errors. seems it's impossible to use g_get_user_config_dir() to get $XDG_CONFIG_HOME. we can find a way to read system defined $XDG_CONFIG_HOME, and use gdm_session_worker_set_environment_variable() to store it in worker->priv->environment. use g_hash_table_lookup (worker->priv->environment, "XDG_CONFIG_HOME") to get it.
Created attachment 171806 [details] [review] GDM xdg patch(workable but not complete) this is the patch i am using. i am afraid i can not find a way to get $XDG_CONFIG_HOME. so the gdm will use the second way:~/.config
Review of attachment 168745 [details] [review]: Ack
Hi, This bug doesn't show any activity since 1 year and that's a pity to me since some work has already been done... What is the status of the proposed patch ? Thanks
Created attachment 212908 [details] [review] Try to save session log to XDG cache dir
Created attachment 212909 [details] [review] Use $XDG_CONFIG_HOME/X11 for X11 resources
Thanks everyone who looked into this and sorry for the slow response. I'll look at the latest two patches now.
Review of attachment 212908 [details] [review]: I feel like the commit message needs more rationale too it. looks mostly fine ::: daemon/gdm-session-worker.c @@ +1897,3 @@ + + if (worker->priv->is_program_session) { + fd = _open_program_session_log (worker->priv->log_file); this part doesn't depend on home_dir/cache_dir/log_dir so it should be moved out of the if (home_dir != NULL) code
Review of attachment 212909 [details] [review]: This is fine, though maybe it would be better to fall back to the old locations if the new ones don't exist.
Review of attachment 212908 [details] [review]: It would be good if the commit message spelled out that this renames ~/.xsession-errors to ~/.cache/gdm/session.log. .xsession-errors is one of the few dotfiles that many people know about, so we shouldn't just sweep this change under the rug.
Review of attachment 212909 [details] [review]: I don't think this makes sense, tbh. These files are legacy first-gen X11 things. Better to cut them off than dragging them into a new location.
Created attachment 213129 [details] [review] Try to save session log to XDG cache dir This moves the default location of the session log message from ~/.xsession-errors to $XDG_CACHE_HOME/gdm/session.log This helps avoid clobbering the log files when shared home directories are used. See https://live.gnome.org/GnomeGoals/XDGConfigFolders
Comment on attachment 212909 [details] [review] Use $XDG_CONFIG_HOME/X11 for X11 resources I'll just drop this one.
*** Bug 704879 has been marked as a duplicate of this bug. ***
a response on 704879 notes that .xsession-errors are written to journald if available. I'm noting that here, since that file is cited above. $XDG_CACHE_HOME/gdm/session.log is the fallback if journald is not available.