Author Topic: RPI 2 shutdown button script ?!  (Read 5287 times)

Maouu

  • Full Member
  • ***
  • Posts: 27
    • View Profile
RPI 2 shutdown button script ?!
« 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.
« Last Edit: February 12, 2016, 10:26:50 AM by Maouu »

xbs

  • Sr. Member
  • ****
  • Posts: 180
    • View Profile
Re: RPI 2 shutdown button script ?!
« Reply #1 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.
« Last Edit: February 12, 2016, 11:49:05 AM by xbs »

Maouu

  • Full Member
  • ***
  • Posts: 27
    • View Profile
Re: RPI 2 shutdown button script ?!
« Reply #2 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/
« Last Edit: February 13, 2016, 06:34:54 AM by Maouu »

xbs

  • Sr. Member
  • ****
  • Posts: 180
    • View Profile
Re: RPI 2 shutdown button script ?!
« Reply #3 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?

Maouu

  • Full Member
  • ***
  • Posts: 27
    • View Profile
Re: RPI 2 shutdown button script ?!
« Reply #4 on: February 13, 2016, 06:35:50 AM »
Thanks you xbs !!  :)

foreverclumsy

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: RPI 2 shutdown button script ?!
« Reply #5 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

progets

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1271
    • View Profile
Re: RPI 2 shutdown button script ?!
« Reply #6 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?".
« Last Edit: January 02, 2017, 08:27:15 PM by progets »