Page 1 of 2

Shutdownconfig: GUI shutdown

Posted: Thu 22 Sep 2011, 10:37
by BarryK
My blog post explains everything;

http://bkhome.org/blog/?viewDetailed=02489

I have posted a PET for retrofitting to existing puppies, if anyone wants to play with it.

Though, as I have mentioned, it is intended to be used with fairly recent Woof-built puppies (Racy, Wary, Slacko, pemasu's Dpup). Lucid Puppy is built with an older Woof and I don't know if there would be any problems using the PET with it.

One thing I mentioned, the new 'yaf-splash' (gtkdialog-splash) is required. There are some variants of this around. The one in Woof is attached -- it was put into Woof almost a year ago I think -- but if you don't have it, or have a different variant, grab this, gunzip it, make sure it has execute flags set, place at /usr/bin, make yaf-splash a symlink to it:

Code: Select all

# ln -s gtkdialog-splash /usr/bin/yaf-splash
Is anyone interested in internationalizing /usr/sbin/shutdownconfig?

Posted: Thu 22 Sep 2011, 17:04
by Jim1911
Working fine on Three Headed Dog. Great that it has more size selections. However, please consider adding an option to select 4fs save files as shinobar has done with his shutdown application.

Saved without asking on 2nd shuwtdown

Posted: Thu 22 Sep 2011, 20:12
by nancy reagan
Tried it in Exprimo, however on 2nd shutdown, when I did not want to save the garbage I got no choice to, or, not to, save.

Is this the way it is meant to be or did I something wrong ?

Posted: Thu 22 Sep 2011, 20:29
by pemasu
nancy reagan. For dpup exprimo. You need to include the row killall enlightenment pretty much anywhere to the /usr/bin/wmpoweroff and wmreboot scripts.
Thats not Barrys fault. E17 needs that enlightenment has been killed.

I could do that at woof level. Those scripts are prefixed in every release. For pet, you can do it yourself. Easy fix.

About resaving. You need to boot pfix=ram.
PUPMODE=5 is needed for that pet to work. It checks if you have booted at pristine mode without previous save file.
This pet does not create opportunity to create repeated savefiles or not save another session. And I believe installing pets with PPM will be written straight to the savefile anyway. I might be wrong in some aspects. I correct my post according to faults if/when someone corrects me.

Posted: Fri 23 Sep 2011, 03:22
by Flash
Before I try it, will it work with a Racy multisession DVD?

Re: Saved without asking on 2nd shuwtdown

Posted: Sat 24 Sep 2011, 00:55
by BarryK
nancy reagan wrote:Tried it in Exprimo, however on 2nd shutdown, when I did not want to save the garbage I got no choice to, or, not to, save.

Is this the way it is meant to be or did I something wrong ?
Shutdownconfig is only for the first shutdown, when you have booted without any save-file.

Regarding your question about a choice whether to save on subsequent boots, normally no choice is possible. It depends on how you are running Puppy. If running from live-CD (with save-file on hard drive) or frugal installation (on hard drive), the work of your current session is immediately saved on the save-file. Thus, there is no choice possible for not saving it.

However, if you have installed Puppy to a USB drive, or live-CD with save-file on USB, then the current work is kept in RAM and written to the save-file periodically. You can disable saves by the menu System -> Puppy Event Manager, then change the save-interval to zero.

Posted: Sat 24 Sep 2011, 00:58
by BarryK
Flash wrote:Before I try it, will it work with a Racy multisession DVD?
Shutdownconfig is only for the first boot, before any save-file (or save to CD/DVD) is created.

Posted: Sat 24 Sep 2011, 01:03
by 01micko
Hi Barry.. pupdialog can't handle small screens :( reported by aarf

I have been experimenting with <vbox scalable="true"> after detecting screen height (cutoff point is 600) but no good result yet, it may be an avenue of pursuit though.

Other than that the yellow is a bit garish! "lightyellow"?

Worked fine for me on 3 machines with normal screen res.

EDIT.. here is a rough patch that does work well enough, problem is the gui size is hard coded, only for small res, ok for res above 800x600

Code: Select all

9a10,16
> #test screensize and set SCROLLABLE variable 01micko 110924
> SCRNSIZE="`xwininfo -root|grep -iE "height"|cut -d ':' -f2`"
> if [ "$SCRNSIZE" -le "600" ];then #kicks in at 800x600resolution, eee-701 is 800x480
>  SCROLLABLE=" scrollable=\"true\" height=\"400\" width=\"450\"" #leading space is essential
>  else SCROLLABLE=" scrollable=\"false\""
> fi
> 
138c145
< 
---
> #01micko 110924 <vbox> variable
140c147
<  <vbox>
---
>  <vbox${SCROLLABLE}>

Shutdownconfig: GUI shutdown

Posted: Sat 24 Sep 2011, 11:12
by L18L
first step done:
changed scripts
created pot file
translation to German

Created zz_shutdownconfig-1a.pet

Test:
Rebooted wary5141 pfix=RAM
installed German language_pack
installed new zz_shutdownconfig-1a.pet

Menu>Reboot
Screenshot

Next steps (make everything translated) coming soon...

Why not make micko01's scrollable default?

---------------------------------------------------------------
Edited (for the records)
found the bug: not translated first 2 paragraphs

/usr/sbin/shutdownconfig line 576
changed from

T_subdir="`eval_gettext \"You can now choose to save the personal session files to a file, named '${DISTRO_FILE_PREFIX}save.2fs'. Your choice will be remembered at next bootup.

NOTE: You cannot choose to save the session to the entire partition \\\${xPDEV}, as Puppy is installed into a sub-directory '\\\${xPSUBDIR}'. If Puppy had been installed at '/', not in a folder, then you would have the option of saving the session to the entire partition (assuming that the partition does not have any other distro installed in it) which has the advantage of all the free space in the partition available for your session files.\"`"

to

T_subdir="`eval_gettext \"You can now choose to save the personal session files to a file, named '\\\${DISTRO_FILE_PREFIX}save.2fs'. Your choice will be remembered at next bootup.

NOTE: You cannot choose to save the session to the entire partition \\\${xPDEV}, as Puppy is installed into a sub-directory '\\\${xPSUBDIR}'. If Puppy had been installed at '/', not in a folder, then you would have the option of saving the session to the entire partition (assuming that the partition does not have any other distro installed in it) which has the advantage of all the free space in the partition available for your session files.\"`"

Variables in eval_gettext have not been escaped (\\\) so xgettext did not produce msgid

BTW: I had tried to use $(eval_gettext 'message text') but that did not work, just inside backticks it is working.

---------------------------------------------------------------
Note too:
Using eval_gettext has great advantage for translators.
In the example picture it it used also for the button texts, these have to be translated just once and are used twice: on the button and in the explanation text. No translating errors possible :)

Shutdownconfig: GUI shutdown

Posted: Sun 25 Sep 2011, 12:35
by L18L
Here is bugfixed version inclusive Barry's latest changes now :)

Included is German translation
HOWTO make other translations (devx loaded):

cd /usr/share/doc/nls/shutdownconfig
msginit

will create a file <your_language.po>
edit this file in geany
fill the emty strings named msgstr
save it

msgfmt <your_language>.po -o - /usr/share/locale/<your_language>/LC_MESSAGES/shutdownconfig.mo

gettext in rc.shutdown.

Posted: Mon 26 Sep 2011, 12:59
by rodin.s
I was doing the same thing for Slacko langpack but now I'll just use this pet.

I have made Russian mo-file for the pet but I've found some errors and I have changed the code. Errors were in 'sanity check', 'fido', 'crypto', 'file clash'...
I have commented out extra variables and moved back to the original one line code of Barry.
And maybe root2user should also be modified.
Also console part localization will not work in Russian without UTF-8 enabled so maybe for console it should be LANG=C.
I can enable console UTF-8 in my lang-packs but it's not in standard Puppy.

Re: gettext in rc.shutdown.

Posted: Tue 27 Sep 2011, 10:45
by L18L
Barry,
I am hoping it is OK discussing issues of internationalization here, problems, questions, pitfalls, tricks, work arounds and solutions of course.

rodin.s,
thank you very much for your work, finding bugs and fixing them!
I have installed your version and it is working out of the box without ru locale.

Code: Select all

LANGUAGE=ru shutdownconfig
rodin.s wrote:...
And maybe root2user should also be modified.
Also console part localization will not work in Russian without UTF-8 enabled so maybe for console it should be LANG=C.
I can enable console UTF-8 in my lang-packs but it's not in standard Puppy.
If think if the strings are changed into another language before changing to LANG=C it will work. But testing is better than thinking.

UTF-8 might become standard, who knows?

I will have to update German...

Posted: Tue 27 Sep 2011, 12:30
by BarryK
Guys,
See my response here:

http://bkhome.org/blog/?viewDetailed=02499

The latest is zz_shutdownconfig-20110927BK.pet. This is based on what L18L sent me, has 4 - 5 bug fixes plus some small changes.

Shutdownconfig: GUI shutdown

Posted: Tue 27 Sep 2011, 16:41
by L18L
Using zz_shutdownconfig-20110927BK.pet.

SAVE TO A FILE
admin
RECOMMENDED chosen
ext2
save-file name
encryption

First shutdown: name clash
just the title and OK
message missing

fix by changing in line 400:
from
yesno “

Re: Saved without asking on 2nd shuwtdown

Posted: Tue 27 Sep 2011, 19:34
by Sylvander
BarryK wrote:If running from live-CD (with save-file on hard drive) or frugal installation (on hard drive), the work of your current session is immediately saved on the save-file. Thus, there is no choice possible for not saving it.
Can't believe I'm about to contradict you Barry...
...But I have my Lupu-526 [booted from a "live" CD-RW disk, with lupusave in a sub-folder on a partition on an internal HDD] set up so the pupsave on the HDD is treated as though a pupsave on a Flash Drive.
And then I have it configured so it NEVER auto-saves during the session .
And then at shut-down/reboot I'm offered the choice "to save or not to save". :D 8)

Here's an explanation of how I do it.

shutdownconfig_ru

Posted: Tue 27 Sep 2011, 20:05
by rodin.s
I have made po and mo files for Russian for BK.pet.
Translated console lines for rc.shutdown are disabled in poedit.
And I hope that Russian people will not go to console for first shutdown.

Re: Saved without asking on 2nd shuwtdown

Posted: Wed 28 Sep 2011, 00:54
by BarryK
Sylvander wrote:
BarryK wrote:If running from live-CD (with save-file on hard drive) or frugal installation (on hard drive), the work of your current session is immediately saved on the save-file. Thus, there is no choice possible for not saving it.
Can't believe I'm about to contradict you Barry...
...But I have my Lupu-526 [booted from a "live" CD-RW disk, with lupusave in a sub-folder on a partition on an internal HDD] set up so the pupsave on the HDD is treated as though a pupsave on a Flash Drive.
And then I have it configured so it NEVER auto-saves during the session .
And then at shut-down/reboot I'm offered the choice "to save or not to save". :D 8)

Here's an explanation of how I do it.


You are not contradicting me. If you configure things so that you have a save-file in internal HD, but instead of the normal PUPMODE=12 you have PUPMODE=13, then your work will be kept in RAM and flushed periodically. Then you can choose to not-save.

You should be able to achieve that by having "pmedia=ataflash" kernel boot parameter.

My earlier statement was based on the normal way that Puppy is used. The default is that a save-file on HD would be PUPMODE=12.

Shutdownconfig: GUI shutdown

Posted: Wed 28 Sep 2011, 11:01
by L18L
Here is updated shutdownconfig-de.po

Thanks to rodin.s for pointing me to line 61 :)

Catching bugs 4 eyes are better than 2 eyes. :D

Edited
Another bug (German only) was found so attachment deleted
use that of 2 posts down

Posted: Wed 28 Sep 2011, 23:10
by BarryK
Racy 5.1.101 (5.2beta1), "Tiny", is uploaded. See my blog post:

http://bkhome.org/blog/?viewDetailed=02510

L18L and rodin.s,
Would you mind checking the translation in it? L18L, I have not applied your latest changes, could you check that in Racy?

Note that I have separated out the translation for the rc.shutdown and shutdownconfig scripts.

Shutdownconfig: GUI shutdown

Posted: Thu 29 Sep 2011, 12:24
by L18L
translation checked and corrected 1 mistake (mine) in Racy 5.1.101

Attached file contains
shutdownconfig.mo , extract it into /usr/share/locale/de/LC_MESSAGES
and de.po for reference