Xfce Forum

Sub domains
 

You are not logged in.

#1 2012-03-18 15:24:26

rayandrews
Member
From: Vancouver B.C. Canada
Registered: 2011-12-30
Posts: 177

The 'rm ~/.cache/sessions/xfce4-*' bug.

K, so this bug is old news, the one where you restart and you can't close windows, the mouse is an 'X', etc. and the cure is to delete the files mentioned in the title.

Anyway, when I first installed LMDE-Xfce4 I had the problem several times, maybe 25% of the time it would happen. It was very close to making me dump Xfce since that's a hard thing to live with. FWIW I'd just like to report something that could be relevant: I disabled my screensaver 'image' so that it just blacks the screen, and I haven't had the problem since.  When the problem did happen, there was always a screenful of messages on my console to the effect that something was wrong with the screensaver, so that backs up my notion that maybe the bug is somehow related to the screensaver.  Just thought I'd mention it.

Speaking of restarting, as of now I have only one serious remaining complaint with Xfce and that is that on restarting, my workspaces are restored very imperfectly. Sometimes Tbird will restore sometimes not. If I have two running copies (windows?) of Opera, they always stack themselves on the same workspace. Things will restore to a different workspace than the one they were on at shutdown. Text files restore only sometimes.  Mind, the situation was worse with Gnome 2, which didn't restore anything on my 2nd monitor ever, never restored Tbird, etc.  I have two monitors, each with six workspaces, so maybe that's just a case of overload, dunno.  But if that problem with restoring workspaces gets fixed, from my perspective Xfce will be the perfect DE :-)

Offline

#2 2012-04-13 06:28:18

daggoth
Member
From: New Zealand
Registered: 2009-03-05
Posts: 42

Re: The 'rm ~/.cache/sessions/xfce4-*' bug.

rayandrews wrote:

Speaking of restarting, as of now I have only one serious remaining complaint with Xfce and that is that on restarting, my workspaces are restored very imperfectly.

Just to echo your comments, I too had problems getting my various programs/windows to session restore as I would like at startup. Without knowing the nuts and bolts of it, it just never worked reliably for me. I suspect certain programs don't play well with sessions.

So I ended up writing a script that starts up my favourite programs, and that sizes and places them onto the various workspaces with wmctrl and/or devilspie. I then added that script into Session_and_Startup-->Application_Autostart, such that it would always run at startup. And I also deleted any saved sessions, and disabled session saving at logout.

Well, my method wasn't pretty, but it is rock solid at startup. I always get the layout of programs I want on the workspaces I want, no problems. Haven't had to touch it in months.

Offline

#3 2012-04-13 14:32:46

rayandrews
Member
From: Vancouver B.C. Canada
Registered: 2011-12-30
Posts: 177

Re: The 'rm ~/.cache/sessions/xfce4-*' bug.

daggoth wrote:
rayandrews wrote:

Speaking of restarting, as of now I have only one serious remaining complaint with Xfce and that is that on restarting, my workspaces are restored very imperfectly.

Just to echo your comments, I too had problems getting my various programs/windows to session restore as I would like at startup. Without knowing the nuts and bolts of it, it just never worked reliably for me. I suspect certain programs don't play well with sessions.

So I ended up writing a script that starts up my favourite programs, and that sizes and places them onto the various workspaces with wmctrl and/or devilspie. I then added that script into Session_and_Startup-->Application_Autostart, such that it would always run at startup. And I also deleted any saved sessions, and disabled session saving at logout.

Well, my method wasn't pretty, but it is rock solid at startup. I always get the layout of programs I want on the workspaces I want, no problems. Haven't had to touch it in months.

daggoth,

I've heard of guys doing that. I wouldn't know where to start tho. Would you please be so kind as to send me a copy of your script so that I can  steal your methods?

rayandrews at eastlink dot ca

But I do wish the devs would look into this, it's the only thing in Xfce (as it runs here) that is plain busted.

Last edited by rayandrews (2012-04-13 14:34:20)

Offline

#4 2012-04-13 23:46:52

daggoth
Member
From: New Zealand
Registered: 2009-03-05
Posts: 42

Re: The 'rm ~/.cache/sessions/xfce4-*' bug.

Okay, I'll post a bit of that startup script, just so you can see what I did. But it is based on wmctrl, and a kludge - not especially elegant. If/when I reinstall my distro, I think the same thing can be done more nicely with devilspie instead.

A little background here first. There are at least two tools that can help to modify windows, move them between desktops etc - wmctrl and devilspie. Devilspie only acts on windows as they are newly created, according to a set of rules you specify. For example, I have a devilspie rule set that forces iceweasel to always open on workspace 5. Whereas wmctrl acts upon window that are already created.

The nice thing about devilspie is that it has a gui, gdevilspie, that is so easy to use and learn. And available in most repos on most distros.

Anyway, this excerpt of script is wmctrl based. And wmctrl has a good manpage. The command "wmctrl -l " gives a listing of the windows+details that wmctrl sees...

#!/bin/bash

# Some other startup code in here... 

thunar --daemon &

# THE WMCTRL WORKSPACES are numbered starting from 0, whereas the devilspie workspace numbering
# starts from 1
WKSP_THUNAR=3
WKSP_TERM=5
WKSP_GEDIT=2
WKSP_FOX=4

center_workspace() { wmctrl -s $WKSP_FOX 2>/dev/null ;  }

center_workspace
xfce4-terminal --geometry=80x28+5+0 --hide-toolbars --hide-borders --maximize --tab --tab --tab --title="nostrom0" 2>/dev/null & disown
until grep -q "nostrom0" <(wmctrl -l) ; do sleep .2; echo -n X ; done
wmctrl -r "nostrom0" -t $WKSP_TERM  2>/dev/null 
sleep .5

thunar ~/001-MyNotes/  2>/dev/null & disown 
thunar ~/Downloads/    2>/dev/null & disown 

center_workspace
win_exp="001-MyNotes - File Manager"
until grep -q  "$win_exp" <(wmctrl -l) ; do sleep .2; echo -n X ; done
wmctrl -r "$win_exp" -e 0,5,0,701,462 2>/dev/null  	# gravity, x, y, width, height
wmctrl -r "$win_exp" -t $WKSP_THUNAR 2>/dev/null 

center_workspace
win_exp="Downloads - File Manager"
until grep -q  "$win_exp"  <(wmctrl -l) ; do sleep .2; echo -n X ; done
wmctrl -r "$win_exp" -e 0,114,118,701,455   2>/dev/null  #423			# -e 0,114,125,701,423
wmctrl -r "$win_exp" -t $WKSP_THUNAR 2>/dev/null 

center_workspace
TEXTDIR=/home/nostromo/001-MyNotes
cd $TEXTDIR
gedit 2011-xxx--urls-4me-2-firefox.txt 5000-clifu-clippings.txt listtrack-notes.txt zurls.txt z-one-liners.txt ~/scripts/desktop_start_script.sh ~/.bashrc ~/.bash_aliases mint-xfce-mods.txt xfce-hacks.txt  2>/dev/null &  disown 
until grep -q "gedit" <(wmctrl -l) ; do sleep .2; echo -n X ; done
( sleep 2 && { wmctrl -r "gedit" -b add,maximized_horz,maximized_vert 2>/dev/null  ;
               wmctrl -r "gedit" -t $WKSP_GEDIT  2>/dev/null ; } ) &
cd -

Offline

#5 2012-04-14 16:00:52

rayandrews
Member
From: Vancouver B.C. Canada
Registered: 2011-12-30
Posts: 177

Re: The 'rm ~/.cache/sessions/xfce4-*' bug.

daggoth wrote:

Okay, I'll post a bit of that startup script, just so you can see what I did. But it is based on wmctrl, and a kludge - not especially elegant. If/when I reinstall my distro, I think the same thing can be done more nicely with devilspie instead.

Thanks daggoth that's very interesting. So far I've not done anything at all like that, I just use my windows in the plain vanilla out of the box way. I know there's window managers out there that are supposed to do wonderful things but it's all Greek to me.  I don't even know how you install some of these toys in such a way that you can change your mind if you don't like them.  So many toys so little time.

Offline

Board footer

Powered by FluxBB