It would appear that on Aug 18, James Bowlin did say:
> 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.
That's more than I want. I just wanted most 'gui' apps (or at least those I
bothered to specifically check for running instances of them) to save any
changes to open documents before they die. In the case of browsers I'd
rather they didn't save any tabs etc. But as long as they offer me a choice
to simply open a new session (without restoring) the next time they run I'm
happy.
> 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.
I don't know much about pearl scripts But I gather that this:
> system("eesh", "wop", $id, "close");
is how it's sending the window referenced by "$id" "window" the close
command... I don't suppose that the process of closing the window an
application is running in causes most gui apps to save changes to open apps
before they die does it?
Still, in any case thanks for the script...
It would appear that on Aug 19, P Purkayastha did say:
> There is no cheat list available. What I wrote is for a *non-interactive
> automated* graceful shutdown of the application. If you want something
> like that then you will have to research each application that you use
> frequently and/or care about, and determine what command will do such a
> graceful shutdown.
Since most apps are not sure if I'd rather save any unsaved changes to open
documents, or not I doubt a non-interactive application shutdown would
suffice.
> Otherwise, as raster mentioned, use e17 and be prepared to be prompted
> for more time to logout everytime some app doesn't want to quit. And
> then you will again have to "continue scrolling through my virtual
> desktops, shutting things down"!! :-)
It looks to me like whether I'm using e16 or e17 my habit of scrolling
through my virtual desktops prior to a shutdown and/or (when in desperate
hurry) just shutting down without and hoping I didn't lose anything
important. will remain the order of the day... But thanks to an
example in a URL I think James posted, I learned how to give my user (I
went with %wheel rather than username) sudo permissions to poweroff.
and wrote a simple script that uses dialog (openSuSE 11.3 doesn't seem to
have xdialog in the repo...) for a confirmation prompt... (see attached)
There's probably a better way to check if X is running than relying on the
existence of a running instance of startx, but that part works for me...
My only concern is whether I'm likely to do any damage to a running
window manager if I execute a poweroff command without letting them
close down first. ( would have to be in a real hurry for that though )
--
| ~^~ ~^~
| <?> <?> Joe (theWordy) Philbrook
| ^ J(tWdy)P
| \___/ <<jtw...@ttlc.net>>
#!/bin/bash
# Note: this script will only work if user has NOPASSWORD sudo
# permisions for the poweroff command
xXx=""
# check for startx to see if "_I'm_" running an xserver Since I
# always use sxtartx this should do it...
xXx=$(ps -A | grep startx$)
case $xXx in
*startx) xXx="yes";;
*) xXx="no";;
esac
if [ "$xXx" = "yes" ]
then
xterm -fn 12x24 -e 'dialog --yesno "What?!? Really CRASH the X server
via system halt (poweroff)??" 10 40 && sudo /sbin/poweroff'
# xterm -fn 12x24 -e 'dialog --yesno "Crash out of X && Halt system?
(poweroff)" 10 40 && display
/home/jtwdyp/images/desk-9/hot/duh/stopMe_half.jpg'
else
dialog --yesno "Halt system? (poweroff)" 10 40 && sudo /sbin/poweroff
# dialog --yesno "Halt system? (poweroff)" 10 40 && display
/home/jtwdyp/images/desk-9/hot/duh/stopMe_half.jpg
fi
------------------------------------------------------------------------------
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
enlightenment-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-users