site  contact  subhomenews

GUI shutdown

September 21, 2011 — BarryK
Most readers would know that shinobar developed 'pupsaveconfig', which provides GTK dialog windows to create a save-file (to save session at first shutdown), rather than the text-mode dialog windows that have always been offered in Puppy.

Here is the Forum thread on pupsaveconfig 1.9.9:
http://www.murga-linux.com/puppy/viewtopic.php?t=60678

Excellent work, but I never put that into Woof, as I wanted to do it a bit differently. Over the last few days I have implemented it the way I want.

For the sake of efficiency, I wanted all of the code in /etc/rc.d/rc.shutdown that presents the dialog windows to work with or without X -- without then use 'dialog', with then use ...well, Xdialog would be the usual choice.

I took all of the code concerned with saving the session out of rc.shutdown, and created /usr/sbin/shutdownconfig. This is called from rc.shutdown when shutting down without X running. However, when shutting down from the desktop, the two scripts that handle exiting from X, /usr/bin/wmpoweroff and /usr/bin/wmreboot, now call shutdownconfig. So, the same code is called, with or without X running.

I wrote 'pupdialog', which has simple compatibility to 'dialog', but runs in X with GTK dialog windows. Currently it supports the --msgbox, --yesno, --menu and --inputbox dialogs. It uses gtkdialog3 or gtkdialog4.

What happens now, is at the first boot (or "pfix=ram", that is, PUPMODE=5), when power-off or reboot is chosen from the Shutdown menu, dialog windows now appear on the desktop, before X exits. So, you get a nicer interface and can use the mouse for selecting.

If you still want the old non-X shutdown dialogs, just exit from X to the prompt and type in "poweroff" or "reboot".

This will be in the next upload of Woof. It is not yet internationalized, I want to be sure that it works properly first.

Comments

shutdown 118n
Username: L18L
[i]This will be in the next upload of Woof. It is not yet internationalized, I want to be sure that it works properly first. [/i] A wise decision. Thank you, Barry. BTW, why not take yad for X ?

Re yad
Username: BarryK
"I needed drop-in replacement for 'dialog'. Also, I wanted to tweak the appearance in various ways not possible with Xdialog.

re "Pupsave not now"
Username: 01micko
"FWIW.. I think that many more things in woof should be flexible, that is, easier to add or remove, Woof is very Wary/Quirky/Racy centric and this does make things more difficult for you (Barry) and me. For you, because you have to maintain that little sub-strata. Also, users like Nancy miss out on outstanding new developments, some of which can be back ported as PETS.

PET for new shutdown
Username: BarryK
"Ok, I'll create a PET for it, so the new shutdown GUIs can be retrofitted to existing puppies. You would have to install it either when building in Woof, or at the first bootup, before shutting down. Or, of course, install it then remaster Puppy.

shutdownconfig PET
Username: BarryK
"Ok, I have created a PET for the GUI shutdown, so it can be retrofitted to existing puppies. Those building puppies with Woof can also use the PET without having to wait to upgrade Woof. http://distro.ibiblio.org/quirky/test/zz_shutdownconfig-1.pet It is working great for me. Retrofitting though, will only work so-far back... the PET has a replacement /etc/rc.d/rc.shutdown that may make some assumptions that are inappropriate for older puppies. The new 'yaf-splash' is used (yaf-splash is actually a symlink to 'gtkdialog-splash'), which has been in Woof for the last several months I think -- the shutdown will crash if tries to use the original yaf-splash. Anyone interested in internationalizing the script? The script is /usr/sbin/shutdownconfig. It needs someone with experience in doing this, 'gettext' conversions inserted at the appropriate places. Note that 'shutdownconfig' can be run directly for testing, without having to do an actual shutdown. A note about 'pupdialog', which is also in the PET. I have to pat myself on the back with this one, nicely coded and very easy to add support for more dialog box types in the future. The PET also has 'pupkill', which is a wrapper for 'kill', adds proper killing of pupdialog dialog windows.

re shutdownconfig
Username: 01micko
"Thanks BK I will be adding this to Slacko B4 (due at worst before Sunday, hopefully tomorrow) Cheers PS: does it include you new pupdialog? (or depend on)

Shutdownconfig Forum thread
Username: BarryK
"I started a Forum thread to give this wider exposure and testing: http://murga-linux.com/puppy/viewtopic.php?t=71911 01micko, Yes, 'pupdialog' is in the PET.

i18n shutdown
Username: L18L
"[i]Anyone interested in internationalizing the script?[/i] I will do it

No TXT
Username: Ted Dog
"The use of full screen terminal (non-Xwin) is a real issue with EFI booting/shutdown on iPuppy (MacTel based puppy) effort. Glad to see this going forward.

zz_shutdownconfig
Username: BarryK
"01micko, No, this PET is only temporary. I will remove it soon. The scripts are part of Woof, and those who build new puppies are expected to use latest Woof. rc.shutdown in particular is a key script in Woof, having it in a separate PET as well is asking for trouble. L18L, Thanks, much appreciated!

busybox, xfprot
Username: technosaurus
"speaking of common repo... when the directory names are changed/moved/deleted, it kinda breaks stuff... just glad I don't run from CD/DVD

GUI shutdown update
Username: BarryK
"I have fixed a few things. The 'shutdownconfig' and 'pupdialog' scripts have changed. New PET: http://distro.ibiblio.org/quirky/test/zz_shutdownconfig-20110924.pet One thing was to get all the dialog windows to fit within a 480 pixel height screen. Some small mods in shutdownconfig, introduction of scrollbars to --menu dlg in pupdialog if more than a certain number of items. There was a bug where a "Please wait..." dialog did not get killed. In the dialog window where a choice of partitions is offered, the recommended one is supposed to be pre-highlighted. Fixed. I also changed the background colour to somewhat paler. The main windows have yellow background, now a pale yellow.

GUI shutdown i18n
Username: L18L
"i18n on old version http://www.murga-linux.com/puppy/viewtopic.php?p=567171 Can you repeat the fix on this or shall I try to do it ? Regards

GUI shutdown i18n
Username: L18L
"Forget it, please I have applied your changes, an easy exercise using Xfdiff-cut. Have a nice sunday evening

pupsaveconfig is not shutdownconfig
Username: BarryK
"Just to clarify something. I noticed a post on the Forum, someone is confused about the relationship between shinobar's pupsaveconfig and my shutdownconfig. I did not use any of shinobar's code. My effort was done from scratch. So, there is no relationship between the two other than that they solve similar problems. My shutdownconfig currently only does one thing, supply X GUI dialogs when shutting down for the first time (PUPMODE=5). Shinobar's package does that, plus has some extra features, such as being able to modify or clone an existing save-file, or create a new one. I might add such extra features later.

re shutdownconfig
Username: 8-bit
"A little while back shutdown was modified so that one had a clean shutdown. Was this feature retained in the GUI version?


Tags: woof