Closed loaidheach closed 1 month ago
I agree that the last-used session being stored as the default on the login screen would be a nice feature. As it is, it appears to default to whatever session file is alphabetically first in the session_dirs
directories. Users who do not use the alphabetically first session need to manually change it every time they log in.
Currently it should already store the last user and the last session, but the session is not stored on a per user basis.
That said, ensure that /var/cache/nwg-hello/cache.json
exists. It should be created during installation. For me using the (unofficial) NixOS package it was not.
Ah, I see. Thank you for the clarification; I do see that file and after looking at it I understand what is happening.
{
"session": "sway",
"user": "jeremy"
}
I was testing something unrelated, and had multiple .desktop
files in /usr/share/wayland-sessions/
with identical Exec
lines. The cache.json
file appears to use this line for differentiating between sessions, so all of those test .desktop
files would rightly appear to be exactly the same.
Since this kind of setup would never have a practical reason to exist on an actual user's system, this seems like a non-issue in my case.
Apologies for hijacking your issue @loaidheach, at first glance I thought you had made the same observation that I had, but now I see my thing is totally unrelated. Thanks again for the tip on /var/cache/nwg-hello/cache.json
.
Due to an influx of real life job, I haven't had much time lately. I'll try to get down to it soon.
No worries and thanks for creating nwg-hello at all!
I should have some time to look at it tomorrow. I will implement it tomorrow and create a pull request.
It would be nice if the last session could be stored on a per user basis. I haven't looked at the code in detail, but in looks like it should be relatively easy to implement. Apart from changing the session when the user select is changed (via
notify::selected
), thecache.json
would need a different format, e.g.