15

I'm running Xubuntu 13.10 with xfce4-panel 4.10.1 and my sessions keeps getting saved involuntarily. I'm well aware that this is a bug so I'd like to ask if anyone knows a workaround to permanently disable/delete this feature (by removing/editing some files maybe)?

I've spent hours searching and tried a lot of the methods already but none of them worked, or at least were not permanent. Some of the stuff I've tried:

How can I turn off Xfce session saving system-wide?
(This basically just removed the tick-box in the logout prompt)

Xubuntu reopens last session applications even though it shouldn't
(Deleting the cached sessions was not a permanent solution)

I would greatly appreciate your help!

My temorarily solution:
I created a simple bash script and placed an application launcher (which runs the script when pressed) on my task panel. The script will delete the "~/.cache/sessions" directory and promt log out.

The script can be found here: http://pastebin.com/aqx483pn

Basically this will be the button which you use to logout/reboot/shutdown.


Update: This only occurs if you added "restart" to the listing, in your "Action Button" (the button with your username written on). If you restart using log out -> restart it should reboot normally and not save your session. Thus, the temporarily solution above is not necessary, I will leave it there as a reference.

Organic Marble
  • 23,641
  • 15
  • 70
  • 122
stacked-cabbages
  • 153
  • 1
  • 1
  • 5

4 Answers4

15

The solution is two-step.

  1. Disable Automatically save sessions on logout in Settings > Sessions > General > Logout Settings. Also make sure that you disable Save session for future logins in the Logout prompt (the window that pops when you actually try to logout).

    See:

  2. You need to log out, delete the contents of ~/.cache/sessions, then log into a clean session. (You can also delete your current session via Settings > Sessions > Session > Clear Saved Sessions.)

    See:

landroni
  • 5,941
  • 7
  • 36
  • 58
  • As mentioned, this is a bug. I've already set every single option related to session to off, at those that have a GUI. Thanks for the reply! – stacked-cabbages Mar 02 '14 at 16:06
  • 1
    Did you try the non-GUI solution? – landroni Mar 02 '14 at 19:47
  • 1
    Yes, I've been using it as a temporarily solution. The problem is that the sessions keep getting cahed thus the session directory and its file keeps coming back. (gonna update the first post with the temporarily "solution" I'm using now) – stacked-cabbages Mar 03 '14 at 09:00
  • Strange. Did you make sure that you removed the cache after logging out from Xfce? In any case, I'm not seeing this behaviour that you describe (I have the two relevant settings turned off). You may have better luck with 4.12, that you can install from https://launchpad.net/~xubuntu-dev/+archive/xfce-4.12 . – landroni Mar 03 '14 at 12:07
  • I've located where the problem arises. It is when you use the "action buttons" from xfce's panel. I think it only affects restart and maybe log out. And deleting the session folder after logging out doesn't do it.

    Before trying to update xfce, I'd like to ask you if it will bring any changes to my current settings?

    – stacked-cabbages Mar 03 '14 at 13:58
  • Yes and no. The upgrade should take into account old settings (you may of course keep a backup, though). And beware that this is unreleased, beta software. This said, I'm running 4.12 and it's rock stable. And in my experience Xfce updates behave OK wrt to old prefs. – landroni Mar 03 '14 at 14:17
  • Alright, I will perform the update then but first I'd just need to make sure, is it "~/.config/xfce4" that should be backed up? I have only been using Xubuntu for a week thus I'm not really used to the location of everything. – stacked-cabbages Mar 04 '14 at 01:10
  • Just to be safe, you could backup ~/.config and ~/.local, where most Xfce-related config files seem to reside (e.g. there is ~/.config/Thunar, etc.). – landroni Mar 04 '14 at 06:58
  • I followed this guide: http://goo.gl/SUQVON to install the latest updates, though it did not actually get updated. I'm still on the same version. Also my "s" key got messed up during the process of installing this for some reason. When I press "s" the computer takes it as I'm pressing "ctrl + s". Any thoughts on what went wrong? Edit: I tried using the backed up .config and .local, still the same. – stacked-cabbages Mar 04 '14 at 16:48
  • Well, what matters is the version of the individual components; here I'm running 4.12, but the About dialogue still indicates 4.10. Strange to hear about the "s" key. Perhaps you have some customizations lying around somewhere? Also have you checked both WM > Keyboard and Keyboard > Shorcuts that "s" is not bound to anything? – landroni Mar 04 '14 at 17:21
  • 1
    I see! thought it was suppose to change. And yes, I double checked the keyboard settings, nothing unusual there. I've also located the real culprit now that I tried it on my other laptop. If you add the "restart" button to the listing in your "action button" and use it, it will automatically save you session upon reboot. However, if you click "restart" via the "log out" menu (xfce4-session-logout) it won't save your session. I just have to avoid using that shortcut I guess. – stacked-cabbages Mar 04 '14 at 18:06
  • I really appreciate you taking your time to help me btw but should I accept your answer? It can partially solve the problem for some people. Not sure how things work around here.

    Additionally, I decided to just reinstall the whole system to get rid of junk that might have caused the "s-button" error.

    – stacked-cabbages Mar 04 '14 at 18:07
  • Great to hear. Yes, I guess this answer (plus the comments) answers your original question, so you can accept and upvote. It seems that this issue has already been reported upstream: https://bugzilla.xfce.org/show_bug.cgi?id=10116 . – landroni Mar 04 '14 at 20:53
6

Delete existing sessions:

rm .cache/session/*

Make directory read-only:

chmod -w .cache/session

You can enable session-saving by granting Write right on the directory:

chmod +w .cache/session

Tested with Xubuntu 14.04.

Pablo Bianchi
  • 15,657
ern0
  • 111
2

I'm sorry if it isn't answer, but I can't comment.

I have had the same problem with that bug. And I "resolved" it by using "delete part" of your script:

#!/bin/bash

#edit.1: It will be launched by root, so we have to use full path here. DIR=/home/USERFOLDER/.cache/sessions/

delete_sessions(){ # Deletes whatever is in DIR rm -r -- "$DIR" }

is_directory(){ if [ -d "$DIR" ]; then delete_sessions else echo "wtf man, it's not there?!" fi }

is_directory

I execute this-way modified script on reboot and shutdown.

This can be set-up according to instructions here.

Pablo Bianchi
  • 15,657
0

One (crude)way is patching /usr/bin/xfce4-session

searching into xfce4-session

objdump -D /usr/bin/xfce4-session | grep '<gtk_toggle_button_set_active@plt>$' -B2

2319b: 8b 74 24 24 mov 0x24(%rsp),%esi 2319f: 48 89 c7 mov %rax,%rdi 231a2: e8 f9 04 ff ff call 136a0 <gtk_toggle_button_set_active@plt>

according to documentation

void gtk_toggle_button_set_active (
  GtkToggleButton* toggle_button,
  gboolean is_active
)

if we pass FALSE to is_active the toggle button is disabled

this can be done by patching

these bytes 8b 74 24 24 with these 31 f6 90 90

the result looks like this

objdump -D /usr/bin/xfce4-session | grep '<gtk_toggle_button_set_active@plt>$' -B4

2319b: 31 f6 xor %esi,%esi 2319d: 90 nop 2319e: 90 nop 2319f: 48 89 c7 mov %rax,%rdi 231a2: e8 f9 04 ff ff call 136a0 <gtk_toggle_button_set_active@plt>

noni
  • 1
  • I've attempted to clean up your post with better formatting, but I'm still not quite sure it's quite right. Can you review and fix as needed? – NotTheDr01ds Mar 17 '23 at 12:40