On Tue, Aug 17, 2010 at 05:53 PM, Joe(theWordy)Philbrook said:
> If it was because my user account didn't have permission to run these
> shutdown commands (without a sudo password prompt) then I wonder why
> they succeed in shutting down the x server???
IIUC, e16 can either just shutdown ("eesh exit") or shutdown by
via exec'ing some program ("eesh exit exec $SOME_PROGRAM"). Even
if that program is bogus, e16 is already shut down before there
is even an attempt to run the program. If you launched e16 via
"startx" or "initx" then the X server will get shut down when e16
exits regardless of what the exec program does. If you started
e16 via a program like xdm or kdm or gdm then you should just end
up back at the *dm login screen when e16 exits. The X server and
*dm should not shut down unless the program that is exec'ed shuts
them down.
> [...] ... But I'm curious. If e16 relies on the system
> reboot and poweroff commands, does that mean that applications
> like openoffice.org wouldn't get to ask me if I wanted to save
> any changes???
I'm glad you asked. My understanding is that regardless of the
poweroff and reboot commands, when e16 shuts down, all open
windows get annihilated. So if you just do an "eesh exit" you
will either get back to a virtual console (like doing a
Ctrl-Alt-F1 -- Ctrl-Alt-F6) or you will get back to the xdm, kdm,
gdm login screen and in either case all the windows you had
opened will have been annihilated.
I wrote a little shell script that allows e16 to exit more
gracefully. You can already exit more gracefully by putting your
own shutdown scripts in the ~/.e16/Stop directory. You could have
a script that looks for active open-office programs and then
shuts them down gracefully if found.
I wanted to "save state" during the shutdown process so all open
terminal windows, GVim windows, and browser windows would be
saved and regenerated when e16 starts up again. (I wasn't
completely successful). E16 can kinda sorta do this already with
the "remember" functionality but I couldn't figure out how to get
it to do exactly what I wanted, for example: automatically remembering
browser tabs, terminal tabs, and GVim tabs.
When I tried to do this myself via ~/.e16/Stop scripts, I found
out that if the scripts are blocking e16 (which they have to be in
order to save window information before e16 shuts down) then any
calls to eesh cause e16 to hang. I was using eesh to get
position, size, and desktop information about the windows I
wanted to save and restore.
I got around this problem by writing my own e16-logout script.
The script will run all the scripts in the ~/.e16/Logout directory
and then when they are all done it will run either:
eesh exit
or
chvt 1
eesh exit exec /sbin/poweroff
or
chvt 1
eesh exit exec /sbin/reboot
depending on what command line parameter passed in. This
allows me to run scripts that call eesh at shutdown time without
locking up the system.
This works great. I posted an early version of e16-logout here:
http://forum.enlightenment.org/comments.php?DiscussionID=495&page=1#Item_4
I think the only thing missing is the chvt commands that switch
the user to one of the virtual consoles.
If you don't need to call eesh during your graceful shutdown then
don't bother with my script and just put your shutdown scripts in
the ~/.e16/Stop/ directory. Make sure they are executable and if
you want them to block e16 (which you probably do) then the
filenames of the script(s) must end in ".sh". They don't have to
be shell scripts. Perl scripts, or even binaries will work fine
as long as the name ends in ".sh".
Peace, James
The most beautiful thing we can experience is the mysterious. It
is the source of all true art and all science. He to whom this
emotion is a stranger, who can no longer pause to wonder and
stand rapt in awe, is as good as dead: his eyes are closed.
-- Albert Einstein
------------------------------------------------------------------------------
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