Open dorsiflexion opened 4 years ago
I think so.
.xsession-errors
in $HOME
is not a good idea, I think it will be more suitable where it is in $XDG_CACHE_HOME
or $XDG_RUNTIME_DIR
+1 to this, it would be great to have a configurable location for .xsession-errors. i ended up binary hacking /usr/sbin/lightdm to change the hardcoded name to the ".cache/xs-errors".
funny enough, this issue dates back to 2012 (if not earlier): https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/1001035
This is a simple, but useful change. Uncontrollable growth of .xsession-errors
in $HOME
and, in general, its presence there drive people nuts all over the web. Please, fix this in the upcoming release.
Quick'n'dirty hack:
--- a/src/session.c 2018-08-30 02:28:55.000000000 +0200
+++ b/src/session.c 2020-01-08 14:57:16.495681494 +0100
@@ -981,7 +981,7 @@
{
SessionPrivate *priv = session_get_instance_private (session);
- priv->log_filename = g_strdup (".xsession-errors");
+ priv->log_filename = g_strdup (".cache/xsession-errors");
priv->log_mode = LOG_MODE_BACKUP_AND_TRUNCATE;
priv->to_child_input = -1;
priv->from_child_output = -1;
doesn't follow $XDG_CACHE_HOME
but works for me.
There's even dirtier hack that doesn't require recompilling or anything... you can just edit /usr/sbin/lightdm in ghex (or any binary editor) and find the null ended string '.xsession-errors', and replace it.
Very important: you shouldn't change the the size of the string but you can put a dirname (with /) there..
There's even dirtier hack that doesn't require recompilling or anything... you can just edit /usr/sbin/lightdm in ghex (or any binary editor) and find the null ended string '.xsession-errors', and replace it.
Very important: you shouldn't change the the size of the string but you can put a dirname (with /) there..
Just discussed today with colleagues, this pandemic drastically changed everyone. You seem to have become very bold, Sir. :)
It was just obsessive for me to fix it today and apt build-dep lightdm wanted too many staff so that's what I did... ;)
btw. I remember modifying mbr using ghex and dd to resize root partition without unmounting so... ;P
Any updates on this simple but useful change?
Friendly bump
Here's a small script I compiled from the above answers. Ubuntu 22.04
if strings /usr/sbin/lightdm | grep -q '.xsession-errors' ; then
sudo apt install bbe
bbe -e 's/.xsession-errors/.cache\x2Fxs-errors/' /usr/sbin/lightdm > outfile
chmod +x outfile
sudo mv /usr/sbin/lightdm /usr/sbin/lightdm-back
sudo mv outfile /usr/sbin/lightdm
fi
Another friendly bump. Having the .xsession-errors file in $HOME doesn't make a lot of sense to me.
Wouldn't there be some crazy coder to add this useful feature? Strange that no one is looking into it, complicated to implement maybe.
another bump
bumpy ride...
@robert-ancell would you please kindly have a look at #287 or provide a reason why this change is unwelcome?
LightDM always uses
$HOME/.xsession-errors
as the log file because it is harcoded. There are several possible reasons for someone to define another location, for example to write it into the RAM or to just have a tidier$HOME
-folder.$HOME
just isn't the right place for the file. ~$XDG_RUNTIME_DIR
(that's/run/user/$UID
with systemd) or$XDG_CACHE_HOME
(=$HOME/.cache
)~$XDG_STATE_HOME
, which defaults to$HOME/.local/state
is much more suitable.Currently there is no way around this one path. So please make it configurable. I could live with a hardcoded path, too, if it was the aforementioned plus an xorg subfolder.
Edit 2023-06-06: Updated to $XDG_STATE_HOME.