1 (edited by auanta 2022-09-08 03:46:34)

Topic: Hibernation in Hyperbola (and a battery script for you!)

Hello all,

I left my  computer suspended for DAYS and I came back to see it was still at 81%! I love that for me!  It required no configuration at all!

However, I have yet to figure out hibernate. Does anyone happen to know how to make hibernation work in Hyperbola?

I'm using syslinux, so the grub solutions don't work.

It appears there is a custom ACPI script . I would edit it, but that's beyond my skill. It's located at /etc/acpi/handler.sh

Bonus, I have a battery script you can use. It needs acpid and herbe as dependencies. You can, if you wish, use espeak too.

#!/bin/bash

# Modified from: https://gist.github.com/bandaangosta/0a0fdbd03215b925576c4b234fc4d4f1
# Credits to user BlackVeils and bandaangosta

# Steps:
# 1. Save this script to battery_notify.sh
# 2. Edit the 'alarm' variable to point to your sound file of choice
# 3. Give execution permission: chmod +x battery_notify.sh
# 4. Run the script to test it. If happy, add to your startup applications.

# Set the alert tone for battery, or leave it as empty quotes.
# choose an audio file
alarm=""

# Notify when below this percentage
low_warning=21

#Notify when above this percentage
high_warning=79

# How often to check battery status, in minutes
check_interval=5

while true; do
  battery_level=$(acpi -b \
    | cut -d, -f2 | cut --characters=2,3,4 \
    | sed 's/%//g')
  charging=$(acpi -b | grep -c "Charging")

  # When battery is low, and not already charging
  if [ $battery_level -lt $low_warning ] &&
     [ $charging -eq 0 ]
  then
#    play -q -v 0.40 "$alarm" &
# espeak "Atencion, la bateria ya tiene 20%, por favor conecte el cargador" -s 140
    herbe " Low battery: ${battery_level}% " \
      " Bateria tiene 20%, ve a recargarlo! "
  fi

  # When battery is high, and charging
  if [ $battery_level -gt $high_warning ] &&
     [ $charging -eq 1 ]
  then
#    play -q -v 0.40 "$alarm" &
# espeak "Atencion, la bateria ya tiene 80%, por favor quite el cargador" - s 140
    herbe " High battery: ${battery_level}% " \
      " Bateria tiene 80%, disconecte el cargador ahora "
  fi
  
  sleep ${check_interval}m
done
for general troubleshooting: I'm running Hyperbola on a GPD MicroPC, my deblobbed firmwares are iwlwifi (I use a USB wifi adapter instead) and Bluetooth (which I don't miss because it is a security hazard) as well as i915 DMC firmware (which I can safely ignore) and the r8169 but my ethernet works perfectly (maybe even improved)

2

Re: Hibernation in Hyperbola (and a battery script for you!)

Yes: You can use uswsusp for this. Here more information about that kernel-module also: https://wiki.archlinux.org/title/Uswsusp

Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

3

Re: Hibernation in Hyperbola (and a battery script for you!)

You can also use zzz being part of testing and coming with the release 0.4.2. smile

Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

4

Re: Hibernation in Hyperbola (and a battery script for you!)

throgh wrote:

You can also use zzz being part of testing and coming with the release 0.4.2. smile

With or without runit?

wink

If it is without it, I could starting using it on my non libreboot x200 devices and potentially more, without conflict between tpad-tools.

Btw,  thank you all for what you do for the free software community.

I haven't said this for a while, due to not wanting to appear, to be, bribing/playing up to you all, but yeah, I very much mean it.

smile

HyperbolaBSD: The Future of Secure Libre Lightweight Operating Systems!

5

Re: Hibernation in Hyperbola (and a battery script for you!)

Oh, the package "zzz" can be used completely without runit. I'm using it here since weeks on a test-installation. More in details:

fluxbox
tint3 (with common additions)
spacefm
zzz (for suspend)

Before leaving that out: Sure, you need to add the command within /etc/doas.conf as "/usr/sbin/zzz" to execute without password. After that: You are free to do, also with OpenRC. And ... perhaps others to come. But that's quite to early to say as testing is early into this. Runit and OpenRC are the stable ones within our system for the moment, with the thoughts for HyperbolaBSD also.

Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

6

Re: Hibernation in Hyperbola (and a battery script for you!)

throgh wrote:

Oh, the package "zzz" can be used completely without runit. I'm using it here since weeks on a test-installation. More in details:

fluxbox
tint3 (with common additions)
spacefm
zzz (for suspend)

Before leaving that out: Sure, you need to add the command within /etc/doas.conf as "/usr/sbin/zzz" to execute without password. After that: You are free to do, also with OpenRC. And ... perhaps others to come. But that's quite to early to say as testing is early into this. Runit and OpenRC are the stable ones within our system for the moment, with the thoughts for HyperbolaBSD also.

That is good news at least.

Btw, I noticed there  was a low power mode option, what does this do in Hyperbola? Is it like hibernate, or something else?

Just curious...

zzz seems to work fine tho. smile

zzz can be used without runit?

I always get the conflict issue... very strange...

tpad-tools is the only other interest, but no worries...

I suppose I might  not need it anyhow...

I will miss though that one function of random mac address.

tongue

HyperbolaBSD doesn't have any alpha isos yet right?

If there is, you may want to distribute as qcow2 images if anyone has interest in testing... and not the iso itself!

Just a thought till it is at beta stability...

Although maybe not, just again... a thought.

HyperbolaBSD: The Future of Secure Libre Lightweight Operating Systems!

7

Re: Hibernation in Hyperbola (and a battery script for you!)

Yes, zzz can be used alone. And changing the mac-address is also possible: https://www.hyperbola.info/packages/?so … p;flagged=

About ISO for HyperbolaBSD: Not yet as we are working on the kernel.

Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!

8

Re: Hibernation in Hyperbola (and a battery script for you!)

throgh wrote:

Yes, zzz can be used alone. And changing the mac-address is also possible: https://www.hyperbola.info/packages/?so … p;flagged=

About ISO for HyperbolaBSD: Not yet as we are working on the kernel.

As well as the package manager and similar stuff, right? Aka, for HyperbolaBSD...

Aka, its more than just the kernel that needs to worked on, right?

Didn't tpad-tools do this randomly anytime you connected to the internet via x200?

Although, couldn't figure out how to get the backup/thinkvantage functions to work on it yet either. :s

Either way, I am willing to bet you are close to both alpha and beta, given the team has been working on parts of both at the same time.

Watching with interest though when  I can though! smile

HyperbolaBSD: The Future of Secure Libre Lightweight Operating Systems!