Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question

4 Answers 4

up vote 3 down vote accepted

Sagarchalise brought me on the right track, but only half the way.

The place, where to look in Xfce is indeed

$HOME/.cache/sessions

I found a lot of files there, including some empty Thunar- files, xfwm4- files and, interesting for us, xfce4-session-asux:0, where asux 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:

[Session: 2010]
key1=value1
key2=value2
...
LastAccess=1315125649

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 or bash arithmetic (or tell me how in the comments). But at least the age in years is worth calculating:

echo $((1315125649/(365*24*60*60)))
41

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 by

scala> val d = new java.util.Date (1315125649*1000L)
d: java.util.Date = Sun Sep 04 10:40:49 CEST 2011

So I remove the whole section, and after relogin, this session is vanished from my list of sessions.

share|improve this answer

Go to $HOME/.cache/sessions and open the latest file with the name xfce-session-yourdesktopname in a text editor.

All your sessions are listed in the file by name in this format:

[Session: Default] 

or

[Session:somename]

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.

share|improve this answer

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.

cd /usr/share/xsessions
mv gnome.desktop gnome.desktop.backup

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 names xubuntu in place of xfce as it has its own session manager.

share|improve this answer
    
As I expected, only root has write access to /usr/share/xsession and its subfolders. gnome.desktop is of course completly off topic. $HOME/.cache/sessions seems the right thing: older and younger entries, xfce4-session-* and xfwm4-*-files are laying around. After renaming them and relogin (which might take some time) you might get the "accepted" flag, but the /usr/share part should really be removed. The $HOME/.config/xfce4-session directory only contains a 2 and a 4 years old file - this seems to be unrelated too. –  user unknown Mar 9 '12 at 14:14

This is how it goes:

  • Click on Settings manager at the app menu or run xfce4-settings-manager from a terminal
  • Click on 'Session and Startup'
  • Uncheck 'Display chooser on login' on the general tab, 'Session Chooser'
  • Also review the 'Logout Settings' on the same tab.
  • *In session tab, Click 'Clear saved session' *
share|improve this answer
    
I don't want to ignore all settings, but delete some of them. –  user unknown Mar 8 '12 at 20:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.