On Wed, Aug 18, 2010 at 11:32 PM, Joe(theWordy)Philbrook said:
> Do you mean that the developers/maintainers of various desktops that
> do automatically convince most gui apps to prompt for unsaved changes
> during a standard graceful shutdown process such as e17, kde, xfce,
> and I think gnome, etc...
I've got code that saves and restores my GVim and xfce-terminal sessions
complete with tabs and cwd's. It puts the windows in the same place,
same size on the same desktop. I was unable to do the same with firefox
so instead I have a list of firefox sessions that get started when e16
starts. It is possible, by using the firefox history and a program that
is run from the title-bar right-click menu, to add and remove firefox
sessions semi-automatically (that is via the title-bar menu) but I don't
add/subtract firefox sessions that frequently so I haven't bothered with
the automation.
Simply shutting down all windows gracefully like e17 does is much
easier. All you need is the e16-logout script I wrote and then
another script that uses eesh to get a list of all window-ids and then
send each window-id the "close" command. The program can then poll
to make sure there are no windows left. Here is an example of a simple
Perl program that closes all open windows. I don't close the windows
that e16 handles, like the Iconbox and the Pagers. It is easy to skip
additional programs. I don't poll for leftover open windows when the
loop is done but that should be very straightforward to add. When I
got things more or less working like I wanted, I just stopped coding.
The select statements delay 0.2 seconds.
#!/usr/bin/perl
use strict;
my @windows = `eesh window_list`;
for (@windows) {
chomp;
s/^(0x[0-9a-f]+) : //i or next;
my $id = $1;
m/^Iconbox$/ and next;
m/^Pager-\d+$/ and next;
system("eesh", "wop", $id, "close");
select(undef, undef, undef, 0.02);
}
select(undef, undef, undef, 0.2);
__END__
Again, you NEED to use my e16-logout script to run this at shutdown. If
you just plop it in your ~/.e16/Stop directory then e16 will hang when
you try to exit.
Peace, James
When practicing unconditional acceptance, start with yourself.
-- Lojong Slogan
------------------------------------------------------------------------------
This SF.net email is sponsored by
Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________
enlightenment-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-users