Skip to content

Instantly share code, notes, and snippets.

@deadjakk
Created March 19, 2023 19:05
Show Gist options
  • Save deadjakk/04fe1722a061a2580b5f39ff3840c3e8 to your computer and use it in GitHub Desktop.
Save deadjakk/04fe1722a061a2580b5f39ff3840c3e8 to your computer and use it in GitHub Desktop.
OpenRC battery_monitor
#!/sbin/openrc-run
# to install: cargo install --git https://git.sr.ht/~deadjakk/batt-monitor
name="battery_monitor"
description="auto shutoff at 20% battery to prevent data loss"
command_user="root:root"
pidfile="/run/${RC_SVCNAME}.pid"
command="/sbin/battery_monitor"
command_args="-c /usr/sbin/hibernate-ram"
command_background=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment