Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
geerlingguy opened this issue Nov 4, 2024 · 6 comments

Comments

@geerlingguy
Copy link
Owner

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
Copy link

0n1cOn3 commented Nov 6, 2024

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
Copy link
Owner Author

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
Copy link

0n1cOn3 commented Nov 6, 2024

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.

@mharsch
Copy link
Contributor

mharsch commented Nov 13, 2024

I'll just mention that I found it very useful (while setting up the kiosk device) to plug in a mouse and implement the Control+F4 key binding to the middle mouse button using the XBindKeys(1) + XDOTOOL(1) solution described here.

My .xbindkeysrc ended up like this:

"xdotool key 'Control_L+F4'"
  b:2

@mattie47
Copy link

If you end up looking at a physical button option, I've just been down a rabbit hole in how to get it working with labwc - labwc/labwc#2370

@jsuanet
Copy link

jsuanet commented Nov 30, 2024

You can add a button on the HA-dashboard, which activates a HA-shell command that uses ssh to do a shutdown, just like the example for turning the backlight on/off described in issue no 2 #2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants