Attract-Mode Support Forum

Attract-Mode Support => General => Topic started by: Maouu on February 12, 2016, 10:19:37 AM

Title: RPI 2 shutdown button script ?!
Post by: Maouu on February 12, 2016, 10:19:37 AM
Hello,

I would like to know if anyone had a script to turn off the RPI properly when pressing a button ..? I tested a few script available on the internet but the RPI launches the script extinguishing procedure suddenly without me pressing the button :(
I'm going crazy !!

Or maybe it is possible to stop the raspberry at the same time I leave attract mode ?! I don't know how :s

Thanks you very much.
Title: Re: RPI 2 shutdown button script ?!
Post by: xbs on February 12, 2016, 10:58:17 AM
In attract mode settings you can add an exit command, like "sudo shutdown –h", to be executed every time you exit AM through the exit confirmation dialog.
Title: Re: RPI 2 shutdown button script ?!
Post by: Maouu on February 13, 2016, 04:35:58 AM
Thanks you !! It's perfect..

It's possible to modify the text of the dialog exit confirmation ?!! Where is the file ?!

Thanks.

EDIT: I finded !! it’s to /usr/local/share/attract/language/
Title: Re: RPI 2 shutdown button script ?!
Post by: xbs on February 13, 2016, 06:34:46 AM
The language files are located in the language folder.

Change/Add this line after the ;

#
# Interface strings
#
Exit Attract-Mode?;Exit Attract-Mode?
Title: Re: RPI 2 shutdown button script ?!
Post by: Maouu on February 13, 2016, 06:35:50 AM
Thanks you xbs !!  :)
Title: Re: RPI 2 shutdown button script ?!
Post by: foreverclumsy on January 02, 2017, 01:53:31 PM
May I confirm that this is what y'all mean when editing the file.

Code: [Select]
# Interface strings
#
Exit Attract-Mode?;sudo shutdown –h
Title: Re: RPI 2 shutdown button script ?!
Post by: progets on January 02, 2017, 08:24:56 PM
May I confirm that this is what y'all mean when editing the file.

Code: [Select]
# Interface strings
#
Exit Attract-Mode?;sudo shutdown –h

No, they are talking about two different things: 1) shutting down the Pi and 2) changing the words on the screen when choosing to exit attractmode.

To shutdown the Pi when exiting attractmode do this: Configure-->General-->Exit command = sudo poweroff

To change the wording that you see when you are exiting attractmode then change this in the proper language file:
Code: [Select]
Exit Attract-Mode?;Shutdown Attract-Mode?
You can use any wording that you would like in place of "Shutdown Attract-Mode?".