Page 1 of 1

Menubar - Shutdown / Reboot Wizard - Legacy OS 2

Posted: Thu 15 Sep 2011, 12:58
by john biles
Hello Legacy OS 2 users,
I have an old friend who is a bit think so to speak and keeps powering down his Laptop by holding down the "Power Off" button on the case instead of login out from the Applications menu. This really upsets Legacy OS 2 to the point where the xorg config file gets upset and Legacy OS 2 won't boot up anymore........... it's along story.

OK as I'm sick of fixing his laptop, I've written this little script add-on which adds a Shut-Down / Reboot Wizard to the menubar.

Now if he still too stupid to shutdown his laptop proper then there's truly something wrong with his brain. LOL!

For those wanting a quick way to shutdown or reboot Legacy OS 2 then install these 2 tar.gz files by unzipping them to / and Restart Icewm from the menu to update.

Posted: Thu 15 Sep 2011, 16:28
by TLM
I wonder if this would work in the NOP puplets with XFCE? I have always found it annoying to have options in the XFCE shutdown menu that do not apply, and to date i do not believe that the XFCE shutdown manager supports any arguments such as --reboot so as to allow a person to configure their own. Would like to get rid of the standby and hibernate options in XFCE. Running reboot or halt from terminal in xfce broke my installation since they do not provide for shutting down the XFCE window manager properly.

I guess i am just particular. Its a pet annoyance of mine to have buttons or icons that do not work or do not work as expected, or are not applicable to the OS on which they are present, however in my case, it is an issue with the way XFCE is written, not with the puplets themselves.

Posted: Thu 15 Sep 2011, 22:26
by john biles
Hello TLM,
When you unzip the Exit.tar.gz file you'll find a directory called usr inside you'll find 2 directories called sbin and share. In sbin you'll find the script Exit-Wizard, this is the code used. When you read through it you will see the line

<action>icewmpoweroff &</action>

and

<action>icewmreboot &</action>

These are the lines you need to modify for use with xfce maybe change icewmreboot to xfcereboot and see what happens.

Those who know xfce should be able to give advice.

Lastly the icons are in the share directory.

Code: Select all

#!/bin/sh

if [ "`which gtkdialog`" = "" ];then
 xmessage -center -title "ERROR" "This install of Legacy OS 2 has lost the application gtkdialog,
which in turn requires the gtk2 libraries package.
Gtkdialog is needed to run this Wizard.

Press OK button to quit..."
 exit
fi

export Wizard="
 <vbox>
  <hbox>
   <text>
    <label>What do you want to do?</label>
   </text>
  </hbox>
  <hbox>
   <text>
    <label>Shutdown</label>
   </text>
   <button>
    <input file>/usr/share/icons/shutdown.png</input>
    <action>icewmpoweroff &</action>
    <action>exit</action>
   </button>
  </hbox>
  <hbox>
   <text>
    <label>Reboot</label>
   </text>
   <button>
    <input file>/usr/share/icons/reboot.png</input>
    <action>icewmreboot &</action>
    <action>exit</action>
   </button>
  </hbox>
  <hbox>
   <button cancel></button>
  </hbox>
 </vbox>
"

#echo "$WizardWizard" | gtkdialog --stdin
gtkdialog --program=Wizard

unset Wizard
Also the other tar.gz file supplied is for Icewm only. Good Luck!

Posted: Tue 27 Sep 2011, 10:38
by aragon
hi john,

if you want that his way of doing things works without destroying/corupting files, you may look at acpid:
http://acpid.sourceforge.net/

Explanation from Arch-Wiki:
https://wiki.archlinux.org/index.php/Acpid

aragon