Menubar - Shutdown / Reboot Wizard - Legacy OS 2

For talk and support relating specifically to Puppy derivatives
Post Reply
Message
Author
User avatar
john biles
Posts: 1458
Joined: Sun 17 Sep 2006, 14:05
Location: Australia
Contact:

Menubar - Shutdown / Reboot Wizard - Legacy OS 2

#1 Post 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.
Attachments
icewm-menubar-update.tar.gz
(732 Bytes) Downloaded 280 times
Exit.tar.gz
(4.07 KiB) Downloaded 246 times
Menubar-Shutdown.jpg
(39.74 KiB) Downloaded 2289 times
Legacy OS 2017 has been released.

User avatar
TLM
Posts: 183
Joined: Tue 09 Mar 2010, 05:14
Location: Central United States

#2 Post 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.

User avatar
john biles
Posts: 1458
Joined: Sun 17 Sep 2006, 14:05
Location: Australia
Contact:

#3 Post 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!
Legacy OS 2017 has been released.

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#4 Post 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

Post Reply