When logging in to Xubuntu, I get a selection list of saved sessions, most of them is outdated old stuff.
I hit the delete button in a sportive manner. I tried a click to the left, and just a click to the right - no deletion possible.
I went through system menus and menu sections (and the system section of the menu).
Note: Not related: How to remove session entries from LightDM? or Managing the login screen's sessions list which links to it - they handle session-classes like xubuntu vs. xfce, gnome, kde - not different xfce-sessions.
Note: I want to remove some sessions, not all of them. I don't want to start with the session-list deactivated. I have 5 entries and want to remove 3 of them.
Go to
$HOME/.cache/sessions
and open the latest file with the namexfce-session-yourdesktopname
in a text editor.All your sessions are listed in the file by name in this format:
or
Select the entire set of lines from
[Session:somename]
to the next blank line (including the [Session:somename] line and delete them. Save the file.Sagarchalise brought me on the right track, but only half the way.
The place, where to look in Xfce is indeed
I found a lot of files there, including some empty Thunar- files, xfwm4- files and, interesting for us,
xfce4-session-asux:0
, whereasux
is the name of my local machine, the hostname.:0 reminds of the way, the XServer enumerates different instances, which I used rarely, but I used it, so I have a
xfce4-session-asux:1
file as well, and it is rather old, but different sessions aren't stored in different files, but in different sections inside the file.Such a section looks like this:
So you can see the name ("2010" in this case) of the session, a bunch of key-value-pairs, and as last these pairs a LastAccess key. It stores the seconds since 1.1.1970 UTC. It's not short and easy to translate it to a human readable date with
date
orbash arithmetic
(or tell me how in the comments). But at least the age in years is worth calculating:So it is 41 years after 1.1.1970 (ignoring leap years and daylight saving time, and cutting the result to whole years) which is 2011. The other fields can be computed as well - I prefered to do it with
scala
bySo I remove the whole section, and after relogin, this session is vanished from my list of sessions.
update:
I now know the much simpler solution for the date issue, simply put into the shell:
So this can be made into a simple script:
AFAIK most of the display managers handle sessions from
.desktop
files present in/usr/share/xsessions
. I guess renaming it to something else will remove session entries.E.g.
xfce caches its session in
$HOME/.cache/sessions
as well as has configurations in$HOME/.config/xfce4-session
. You could try viewing those folders as well. I think xubuntu has folders with namesxubuntu
in place ofxfce
as it has its own session manager.This is how it goes:
xfce4-settings-manager
from a terminal