How can I change default shutdown to save? (SOLVED)

Moderator: Forum moderators

Post Reply
User avatar
vtpup
Posts: 746
Joined: Sat Aug 15, 2020 2:34 pm
Location: Republic of Vermont
Has thanked: 198 times
Been thanked: 172 times
Contact:

How can I change default shutdown to save? (SOLVED)

Post by vtpup »

F-96 CE v4
pmedia=ataflash

The default save on shutdown with no user action, is not to save.

I'd like mine to default to save on shutdown. Advice appreciated on how to modify to do that.

Thanks!
Steve

Last edited by vtpup on Sat Sep 28, 2024 2:40 pm, edited 1 time in total.

HP Envy Laptop 17t-cr100
Fossapup F-96 CE rev 4
Huge kernel: huge-6.1.8-fossapup64

My homemade foam boat:
www.youtube.com/watch?v=4sDubB0-REg

williwaw
Posts: 1973
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 172 times
Been thanked: 372 times

Re: How can I change default shutdown to save?

Post by williwaw »

vtpup wrote: Thu Sep 26, 2024 7:46 pm

F-96 CE v4
pmedia=ataflash

The default save on shutdown with no user action, is not to save.

I'd like mine to default to save on shutdown. Advice appreciated on how to modify to do that.

Thanks!
Steve

do you still want the choice to "not save" ?

User avatar
vtpup
Posts: 746
Joined: Sat Aug 15, 2020 2:34 pm
Location: Republic of Vermont
Has thanked: 198 times
Been thanked: 172 times
Contact:

Re: How can I change default shutdown to save?

Post by vtpup »

williwaw wrote: Fri Sep 27, 2024 4:58 am
vtpup wrote: Thu Sep 26, 2024 7:46 pm

F-96 CE v4
pmedia=ataflash

The default save on shutdown with no user action, is not to save.

I'd like mine to default to save on shutdown. Advice appreciated on how to modify to do that.

Thanks!
Steve

do you still want the choice to "not save" ?

Yep, Bob, thanks. I just want the default action to be a save.

Save IS presently highlighted, but if I don't hit <ENTER> it doesn't save.
I've lost a lot of work because of that. If you don't (or can't) wait around for the right moment to hit <Enter>, goodbye data.
On the odd occasion when I don't want to save due to a system or program malfunction, I'd rather elect to "close without saving" than have it forced on me.

HP Envy Laptop 17t-cr100
Fossapup F-96 CE rev 4
Huge kernel: huge-6.1.8-fossapup64

My homemade foam boat:
www.youtube.com/watch?v=4sDubB0-REg

User avatar
rockedge
Site Admin
Posts: 6571
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2779 times
Been thanked: 2650 times
Contact:

Re: How can I change default shutdown to save?

Post by rockedge »

@vtpup
Looks like a modification to /etc/rc.d/rc.shutdown could change the behavior.

Open /etc/rc.d/rc.shutdown go to around line 228 and we'll have to look at changing what happens after the --timeout 8

Code: Select all

asktosave_func () {
 # if $RAMSAVEINTERVAL > 0, session is saved automatically
 if [ "$RAMSAVEINTERVAL" ] && [ $RAMSAVEINTERVAL -gt 0 ] ; then
   RETVAL=0
 elif [ "$ASKTOSAVE" = "false" ]; then
   RETVAL=0
 else
   dialog --timeout 8 --yes-label "$(gettext 'SAVE')" --no-label "$(gettext 'NO SAVE')" --yesno "$(gettext 'Press ENTER key to save session... 
Or, press TAB then ENTER to not save session... 
Or, wait 8 seconds to shutdown without saving session...')" 0 0 >/dev/console 
   RETVAL=$?
 fi
 [ $RETVAL -ne 0 ] && echo "$(gettext "Session not saved")" >/dev/console
 return $RETVAL
} 
esos
Posts: 198
Joined: Thu Feb 18, 2021 4:33 am
Been thanked: 20 times

Re: How can I change default shutdown to save?

Post by esos »

F-96 CE v4
pmedia=ataflash

Sofar I remember if you use pmedia=ataflash parameter in F-96 CE v4, you are in pupmode13 that's mean at shutdown/reboot the system will give you 2 options "save" or "not-save".
Just delete/dont use "pmedia=" parameter. The system will automatically in "AUTOSAVE" mode everytime at shutdown/reboot, what I know from the other pup-derivatives.

User avatar
fredx181
Posts: 3112
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 378 times
Been thanked: 1329 times
Contact:

Re: How can I change default shutdown to save?

Post by fredx181 »

@vtpup

Save IS presently highlighted, but if I don't hit <ENTER> it doesn't save.

The thing is, without pressing Enter the return value is 255 (not 0), replacing the function asktosave_func in /etc/rc.d/rc.shutdown with this will save session also if you wait :
(changed the dialog text also to: "Or, wait 8 seconds to save session...")

Code: Select all

asktosave_func () {
 # if $RAMSAVEINTERVAL > 0, session is saved automatically
 if [ "$RAMSAVEINTERVAL" ] && [ $RAMSAVEINTERVAL -gt 0 ] ; then
   RETVAL=0
 elif [ "$ASKTOSAVE" = "false" ]; then
   RETVAL=0
 else
   dialog --timeout 8 --yes-label "$(gettext 'SAVE')" --no-label "$(gettext 'NO SAVE')" --yesno "$(gettext 'Press ENTER key to save session... 
Or, press TAB then ENTER to not save session... 
Or, wait 8 seconds to save session...')" 0 0 >/dev/console 
   RETVAL=$?
   # fredx181 addition, save session also after 8 sec wait, only if you choose "NO SAVE" and press Enter, then the session is not saved
   [ $RETVAL -ne 1 ] && RETVAL=0       
 fi
 [ $RETVAL -ne 0 ] && echo "$(gettext "Session not saved")" >/dev/console
 return $RETVAL
}
User avatar
vtpup
Posts: 746
Joined: Sat Aug 15, 2020 2:34 pm
Location: Republic of Vermont
Has thanked: 198 times
Been thanked: 172 times
Contact:

Re: How can I change default shutdown to save?

Post by vtpup »

rockedge wrote: Sat Sep 28, 2024 3:00 am

@vtpup
Looks like a modification to /etc/rc.c/rc.shutdown could change the behavior.

Open /etc/rc.c/rc.shutdown go to around line 228 and we'll have to look at changing what happens after the --timeout 8

Code: Select all

asktosave_func () {
 # if $RAMSAVEINTERVAL > 0, session is saved automatically
 if [ "$RAMSAVEINTERVAL" ] && [ $RAMSAVEINTERVAL -gt 0 ] ; then
   RETVAL=0
 elif [ "$ASKTOSAVE" = "false" ]; then
   RETVAL=0
 else
   dialog --timeout 8 --yes-label "$(gettext 'SAVE')" --no-label "$(gettext 'NO SAVE')" --yesno "$(gettext 'Press ENTER key to save session... 
Or, press TAB then ENTER to not save session... 
Or, wait 8 seconds to shutdown without saving session...')" 0 0 >/dev/console 
   RETVAL=$?
 fi
 [ $RETVAL -ne 0 ] && echo "$(gettext "Session not saved")" >/dev/console
 return $RETVAL
} 

Thanks @rockedge . I don't have an /etc/rc.c/ folder. I have /etc/rc.d/rc.shutdown though, so that must be it, and it does agree w/above at line 228. So I'm looking at that.

Thanks @esos I believe I do still want pupmode 13 because I don't want immediate saves during a session -- I still want the Save icon on the desktop for optional saves at that time.

I also still want the opportunity not to save at shutdown -- as a choice.

But I want the default shutdown to be a save.

Does that make sense?

Thanks @fredx181 I'll try that!

HP Envy Laptop 17t-cr100
Fossapup F-96 CE rev 4
Huge kernel: huge-6.1.8-fossapup64

My homemade foam boat:
www.youtube.com/watch?v=4sDubB0-REg

User avatar
vtpup
Posts: 746
Joined: Sat Aug 15, 2020 2:34 pm
Location: Republic of Vermont
Has thanked: 198 times
Been thanked: 172 times
Contact:

Re: How can I change default shutdown to save?

Post by vtpup »

fredx181 wrote: Sat Sep 28, 2024 8:15 am

@vtpup

Save IS presently highlighted, but if I don't hit <ENTER> it doesn't save.

The thing is, without pressing Enter the return value is 255 (not 0), replacing the function asktosave_func in /etc/rc.d/rc.shutdown with this will save session also if you wait :
(changed the dialog text also to: "Or, wait 8 seconds to save session...")

Code: Select all

asktosave_func () {
 # if $RAMSAVEINTERVAL > 0, session is saved automatically
 if [ "$RAMSAVEINTERVAL" ] && [ $RAMSAVEINTERVAL -gt 0 ] ; then
   RETVAL=0
 elif [ "$ASKTOSAVE" = "false" ]; then
   RETVAL=0
 else
   dialog --timeout 8 --yes-label "$(gettext 'SAVE')" --no-label "$(gettext 'NO SAVE')" --yesno "$(gettext 'Press ENTER key to save session... 
Or, press TAB then ENTER to not save session... 
Or, wait 8 seconds to save session...')" 0 0 >/dev/console 
   RETVAL=$?
   # fredx181 addition, save session also after 8 sec wait, only if you choose "NO SAVE" and press Enter, then the session is not saved
   [ $RETVAL -ne 1 ] && RETVAL=0       
 fi
 [ $RETVAL -ne 0 ] && echo "$(gettext "Session not saved")" >/dev/console
 return $RETVAL
}

That worked perfectly, Fred! Thank you. I tested it both ways -- with a default save, and with an elected no-save, and both did what they should.

(For anyone unfamiliar with this stuff, open /etc/rc.d/rc.shutdown in a text editor, do a find for asktosave_func and replace everything down to the end bracket } with the above version.)

HP Envy Laptop 17t-cr100
Fossapup F-96 CE rev 4
Huge kernel: huge-6.1.8-fossapup64

My homemade foam boat:
www.youtube.com/watch?v=4sDubB0-REg

User avatar
rockedge
Site Admin
Posts: 6571
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2779 times
Been thanked: 2650 times
Contact:

Re: How can I change default shutdown to save? (SOLVED)

Post by rockedge »

vtpup wrote:

Thanks @rockedge . I don't have an /etc/rc.c/ folder.

Neither do I! It was a mistyped letter. Should be /etc/rc.d

User avatar
pp4mnklinux
Posts: 1141
Joined: Wed Aug 19, 2020 5:43 pm
Has thanked: 638 times
Been thanked: 289 times

Re: How can I change default shutdown to save? (SOLVED)

Post by pp4mnklinux »

vtpup wrote: Thu Sep 26, 2024 7:46 pm

F-96 CE v4
pmedia=ataflash

The default save on shutdown with no user action, is not to save.

I'd like mine to default to save on shutdown. Advice appreciated on how to modify to do that.

Thanks!
Steve

@vtpup , EasyOs let you choose (go for it...) :thumbup2:

added.- @vtpup , I hope you don't consider this an inapropriate answer, I know your question was about F96CE, but I thought knowing the most is the best (excuse me if I disturbed you)

Attachments
image 19 31 47.jpg
image 19 31 47.jpg (73.98 KiB) Viewed 618 times
image 19 27 08.jpg
image 19 27 08.jpg (83.84 KiB) Viewed 621 times
Last edited by pp4mnklinux on Sat Sep 28, 2024 6:26 pm, edited 3 times in total.

PP4MNK

User avatar
fredx181
Posts: 3112
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 378 times
Been thanked: 1329 times
Contact:

Re: How can I change default shutdown to save? (SOLVED)

Post by fredx181 »

pp4mnklinux wrote: Sat Sep 28, 2024 5:29 pm
vtpup wrote: Thu Sep 26, 2024 7:46 pm

F-96 CE v4
pmedia=ataflash

The default save on shutdown with no user action, is not to save.

I'd like mine to default to save on shutdown. Advice appreciated on how to modify to do that.

Thanks!
Steve

@vtpup , EasyOs let you choose (go for it...) :thumbup2:

The question is clearly about F-96 CE v4 and is already marked as (SOLVED), so very off-topic IMO in this context to advertise about EasyOs.
(in other words, you should learn better about what's appropriate posting and what is not)

User avatar
vtpup
Posts: 746
Joined: Sat Aug 15, 2020 2:34 pm
Location: Republic of Vermont
Has thanked: 198 times
Been thanked: 172 times
Contact:

Re: How can I change default shutdown to save? (SOLVED)

Post by vtpup »

pp4mnklinux wrote: Sat Sep 28, 2024 5:29 pm

@vtpup , EasyOs let you choose (go for it...) :thumbup2:

added.- @vtpup , I hope you don't consider this an inapropriate answer, I know your question was about F96CE, but I thought knowing the most is the best (excuse me if I disturbed you)

Nope not disturbed by it, but I also agree that shutdown functionality in another OS doesn't apply to the question, which was ably answered by Fred's mod. Thank you again, Fred.

HP Envy Laptop 17t-cr100
Fossapup F-96 CE rev 4
Huge kernel: huge-6.1.8-fossapup64

My homemade foam boat:
www.youtube.com/watch?v=4sDubB0-REg

Post Reply

Return to “F96-CE”