pplockd: Simple power management/CRUST daemon for X11 GUIs on PinePhone
So now that I've gotten it working how I want, I'll post the daemon I'm using on Fedora XFCE to handle power management, CRUST, etc.
It's written with the following assumptions:
  • You're on an Xorg desktop-oriented GUI on a real Linux distro
  • You don't wanna have to set up essential apps to use wakelocks and all that stuff
  • You can run something as root
  • You have the Xorg utilities xset, xinput, and xrandr installed
  • You have set your DE's power manager to ignore the power button
  • You have Python 3.6 or above. Fedora 32 etc use 3.8 by default.
You can run it from its git repository directory, just ./pplockd, or ./pplockd --nodaemon to keep running in foreground.

You can also copy 'components' to /usr/local/share/pplockd/components, and PPConfig.py to /etc/pplockd/PPConfig.py.

You will need to edit the default user in PPConfig.py, the config file, which also handles the triggers for different buttons.

By default, the buttons are mapped as follows:
  • Hit up then down volume keys to rotate screen from portrait to landscape, including touchscreen input (in sequence, since hardware doesn't allow vol up+down at same time)
  • Hit power button to 'soft lock', leaving the phone running, e.g. if you're playing music but keep the phone in your pocket. This shuts off all but 1 core and scales the remaining one to 600Mhz, in addition to shutting off the screen and touch input. It sets monitor inactivity to 5 seconds (changeable in PPConfig.py) to prevent battery wasteage, since it seems the modem is 'chatty', sending random events quite often, which light up the screen.
  • Hit vol down + power (at same time) to 'hard lock', this does everything soft lock does, but puts the phone to sleep as well. It should wake on incoming calls and texts if you've configured your modem properly. You are given (changeable in PPConfig.py) 30 seconds to hit the power button, then the phone sleeps again. 
  • In any case, you can always wake the phone fully using the power button.
Here's the repo: https://github.com/Subsentient/pplockd

Messages In This Thread
pplockd: Simple power management/CRUST daemon for X11 GUIs on PinePhone - by Subsentient - 06-30-2020, 09:38 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Article: NuttX RTOS for PinePhone: LVGL Terminal for NSH Shell lupyuen 0 58 02-01-2023, 10:11 PM
Last Post: lupyuen
  Article: NuttX RTOS for PinePhone: Boot to LVGL lupyuen 2 157 01-23-2023, 10:41 PM
Last Post: lupyuen
  I2P On Pinephone RTP 0 176 01-17-2023, 04:53 PM
Last Post: RTP
  Article: NuttX RTOS for PinePhone: Touch Panel lupyuen 0 185 01-12-2023, 05:20 PM
Last Post: lupyuen
  Slack on PinePhone Adam Seline 3 2,382 01-04-2023, 09:09 AM
Last Post: nickolas
  Article: NuttX RTOS for PinePhone: What is it? lupyuen 0 297 01-01-2023, 05:45 PM
Last Post: lupyuen
  Article: NuttX RTOS for PinePhone: Framebuffer lupyuen 0 262 12-30-2022, 10:17 PM
Last Post: lupyuen
  'standard' Debian on Pinephone? 4920441 3 480 12-28-2022, 10:40 AM
Last Post: zetabeta
  Article: NuttX RTOS for PinePhone: LCD Panel lupyuen 0 274 12-27-2022, 05:26 PM
Last Post: lupyuen
Lightbulb Article: Experiments for super low PinePhone power consumption with Genode Surehand53 1 644 12-27-2022, 02:21 PM
Last Post: Samurai_Crow

Forum Jump:

Users browsing this thread: 1 Guest(s)