geerlingguy / pi-kiosk

A simple Raspberry Pi Kiosk app
GNU General Public License v3.0
48 stars 0 forks source link

Add some capability to shut down the Pi in software or with external button #1

Open geerlingguy opened 3 days ago

geerlingguy commented 3 days ago

Right now to shut down the Pi once it's booted into Kiosk mode, the only two ways to shut it down are to access it remotely (via Pi Connect or SSH), or to press the physical power button on the Pi 5 (which is awkward and annoying).

It'd be nice if there was a touch gesture like swipe up/down/left/right that brought up a little set of buttons (or just one button) to power down the Pi safely.

Failing that, a design I could 3D print to hold a little power button I could attach to headers soldered to the power button VIAs on the Pi 5 would be acceptable.

0n1cOn3 commented 1 day ago

Hi Jeff!

You could implement a Python script that listens for touch gestures, and upon detecting a specific gesture, displays an overlay with a shutdown button and include that in the kiosk script.

geerlingguy commented 1 day ago

Possibly! The difficulty is Chromium in Kiosk mode takes over the entire display, so I'd have to have something running on top of that, I haven't done any system-level UI programming in Linux before, but I'm guessing it's possible to take over for gestures like a swipe up from the bottom of the screen...

0n1cOn3 commented 1 day ago

Well, this prompted me to write something small this morning.😊 It does only require PyGame as an external library.

But theres a catch: I don't have a touchscreen to test! If you like, I can upload this and link it here.