adafruit / pi_video_looper

Application to turn your Raspberry Pi into a dedicated looping video playback device, good for art installations, information displays, or just playing cat videos all day.
GNU General Public License v2.0
452 stars 239 forks source link

Safely Power down the PI from the looper application #120

Closed timsterathome closed 3 years ago

timsterathome commented 3 years ago

I'm not a Python expert but write apps professionally for Linux using C/C++. Would it be possible to power down the PI from the looper application by adding something like this to _handle_keyboard_shortcuts():

            if event.key == pygame.K_p:
                self._print("p was pressed, shutting down...")
                self._player.stop(3)
                subprocess.run(['sudo', 'shutdown', 'now']) 
tofuSCHNITZEL commented 3 years ago

Hi, check out version 1.0.8. it includes "p" keyboard shortcut for shutdown. cheers!