Shutdownconfig: GUI shutdown

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

Shutdownconfig: GUI shutdown

#1 Post 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?
Attachments
gtkdialog-splash.gz
(2.69 KiB) Downloaded 920 times
[url]https://bkhome.org/news/[/url]

Jim1911
Posts: 2460
Joined: Mon 19 May 2008, 20:39
Location: Texas, USA

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

nancy reagan
Posts: 544
Joined: Thu 22 Jan 2009, 14:20

Saved without asking on 2nd shuwtdown

#3 Post 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 ?

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

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

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#5 Post by Flash »

Before I try it, will it work with a Racy multisession DVD?

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

Re: Saved without asking on 2nd shuwtdown

#6 Post 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.
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#7 Post 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.
[url]https://bkhome.org/news/[/url]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#8 Post 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}>
Puppy Linux Blog - contact me for access

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Shutdownconfig: GUI shutdown

#9 Post 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 :)
Attachments
pupsaveconfig-1a.png
first run
just for fun
better one
coming soon
(17.3 KiB) Downloaded 2357 times
zz_shutdownconfig-1a.pet
for developers ONLY
containing bugs
(50.93 KiB) Downloaded 803 times

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Shutdownconfig: GUI shutdown

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

rodin.s
Posts: 344
Joined: Wed 22 Sep 2010, 19:50
Location: Ukraine

gettext in rc.shutdown.

#11 Post 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.
Attachments
fido.png
fido bottom variable
(31.58 KiB) Downloaded 2429 times
sanity.png
sanity check error
(21.25 KiB) Downloaded 2184 times

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Re: gettext in rc.shutdown.

#12 Post 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...
Attachments
shutdownconfig_ru.png
also for demo that
changing the locale
is not needed
(22.34 KiB) Downloaded 2190 times

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#13 Post 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.
[url]https://bkhome.org/news/[/url]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Shutdownconfig: GUI shutdown

#14 Post 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 “

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

Re: Saved without asking on 2nd shuwtdown

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

rodin.s
Posts: 344
Joined: Wed 22 Sep 2010, 19:50
Location: Ukraine

shutdownconfig_ru

#16 Post 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.
Attachments
27-09-11_2233.jpg
Russian first shutdown in console
(41.41 KiB) Downloaded 540 times
shutdownconfig_ru.tar.gz
Russian mo and po files
(25.57 KiB) Downloaded 550 times

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

Re: Saved without asking on 2nd shuwtdown

#17 Post 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.
[url]https://bkhome.org/news/[/url]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Shutdownconfig: GUI shutdown

#18 Post 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
Last edited by L18L on Thu 29 Sep 2011, 12:33, edited 2 times in total.

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#19 Post 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.
[url]https://bkhome.org/news/[/url]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Shutdownconfig: GUI shutdown

#20 Post 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
Attachments
shutdownconfig-de-po_and_mo.tar.gz
(16.68 KiB) Downloaded 583 times

Post Reply