Commit graph

58 commits

Author SHA1 Message Date
Pig Monkey
39d5cae298 drop framework charge control service
When I first bought my Framework, the battery charge limit reset after
every boot, necessitating something like this. With later firmware
versions, it doesn't reset, so there's no need for a service. Just set
your preferred limit once, using whatever method you like, and then
forget about it.
2025-11-06 16:48:48 -08:00
Pig Monkey
77271b6157 framework-system graduated from aur 2025-07-14 09:03:29 -07:00
Pig Monkey
65d61e3621 switch from fw-ectool-git to framework-system
The only thing I use either of these for is setting the charge limit.
Both seem to work identically. I've been using framework-system for a
month or so and haven't noticed any difference.
2025-06-16 08:06:23 -07:00
Pig Monkey
f8665fa738 switch to powersave profile sooner 2025-01-16 08:26:29 -08:00
Pig Monkey
15e55abc78 add ambient light sensor support
These illuminanced vars are for the Framework 13 AMD. Other systems will
likely need other paths.
2025-01-15 23:00:52 -08:00
Pig Monkey
cde30883b9 replace inotify with sleep
inotify is unreliable on /sys, so just loop forever and periodically
check the state of things.
2025-01-15 18:05:58 -08:00
Pig Monkey
3dd640ed31 monitor AC status rather than battery status
If you set a charging threshold on the battery, you may bounce between
charging and discharging while still on AC. The profile only needs to
change when AC is disconnected. If the battery is discharging, but AC is
connected, don't switch to a power-saving profile.

I think.
2025-01-14 09:22:38 -08:00
Pig Monkey
1d4dc29b73 set battery idle on framework machines
Apparently changes made via ectool only survive power off if the laptop
remains plugged in, so in practice we have to set this on every boot.

https://wiki.archlinux.org/title/Framework_Laptop_13#Battery_control

Setting the lower and upper charge percentage to the same value causes
the controller to idle the battery at that percentage. This seems like
it would be better for the long term health of the battery than giving
the battery a range to constantly dis/charge between. It also feels more
like what I'm used to from all my years of Thinkpads and TLP.

I have also set the max charge on my battery to 90% in the BIOS, as per:
https://guides.frame.work/Guide/Enabling+Battery+Saver+Functionality+in+BIOS/392
2025-01-14 08:23:17 -08:00
Pig Monkey
35b94beb41 auto-switch tuned profiles on battery
I'm not sure if a looping script like this is the best way to accomplish
this. I don't understand why TuneD doesn't provide this functionality
itself, like TLP does.
2025-01-14 08:19:55 -08:00
Pig Monkey
0126cb6ff2 add option for tuned-ppd 2025-01-11 18:37:04 -08:00
Pig Monkey
966b159668 user kewlfft.aur collection
Closes #120 #74
2024-12-01 20:21:53 -08:00
Pig Monkey
83d9fc07ca replace lowbatt.sh with poweralertd
Existing users can remove the old cruft:

    $ sudo systemctl disable lowbatt.timer
    $ sudo rm /usr/local/bin/lowbatt /etc/systemd/system/lowbatt.*
    $ sudo systemctl daemon-reload
2024-07-18 20:09:50 -07:00
Pig Monkey
fbe31fc290 reformat yaml 2023-04-10 17:54:18 -07:00
Pig Monkey
68458a239e replace light with brightnessctl
Closes #107
2023-04-10 17:51:00 -07:00
Pig Monkey
29beab046f replace deprecated include with include_tasks 2022-10-14 17:36:47 -07:00
Pig Monkey
fa81f690c3 switch to powerstat non-git 2021-10-16 11:32:57 -07:00
Pig Monkey
4fce720bd8 systemd stdout/stderr syslog output is obsolete 2020-08-25 15:57:18 -07:00
Pig Monkey
b9353f27f3 upgrade TLP config for v1.3+
The default TLP config now lives at /etc/tlp.conf. Override files should
be installed to /etc/tlp.d/. This allows us to more easily make our few
customizations.

The old tlp-sleep.service systemd unit no longer exists.
2020-02-08 16:06:18 -08:00
Pig Monkey
4d2e15f3d0 install cmake to fix broken battery-stats package 2019-08-25 09:51:39 -07:00
Pig Monkey
6f6e3a171b add battop 2019-06-04 21:56:56 -07:00
Pig Monkey
f5403386f2 set default disk devices from upstream 2019-05-01 18:56:39 -07:00
Pig Monkey
8e33422088 add default battery drivers from upstream 2019-05-01 18:56:16 -07:00
Pig Monkey
14b2ca3071 update TLP comments for easier diffing against upstream 2019-05-01 18:55:55 -07:00
Pig Monkey
a0e7b234c3 install battery-stats 2019-05-01 18:52:49 -07:00
Pig Monkey
2a013e1791 replace deprecated with_items on package tasks
https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.7.html#using-a-loop-on-a-package-module-via-squash-actions
2019-04-25 20:33:04 -07:00
Pig Monkey
f75f1836b0 install powertop and powerstat
We use TLP, so allowing powertop to auto tune or blindly implementing
its suggestions is a bad idea, but it is useful to diagnose power
consumption.
2019-01-23 20:42:08 -08:00
Ben Orchard
c901561b42 install light from main repos (promoted from AUR) 2019-01-09 20:39:40 +00:00
Pig Monkey
94bb34cb76 mask systemd radio socket when using tlp 2018-08-21 08:49:36 -07:00
Pig Monkey
aa0431badc tag libinput tasks 2018-04-13 21:51:37 -07:00
Pig Monkey
ea0f25df20 enable 4.15 med_power_with_dipm 2018-02-11 14:28:09 -08:00
Pig Monkey
9c5a0b3169 update tlp 1.1 config comments for easier diffing
The only functional change here is excluding printers from USB autosuspend,
which is the tlp 1.1 default

ALPM can be changed when kernel 4.15 is released.
2018-02-02 18:50:55 -08:00
Pig Monkey
92aeb4daff replace light-git with light 2017-12-29 09:02:23 -08:00
Pig Monkey
10bc8bd73c merge default tlp config for easier diffing 2017-11-15 10:20:28 -08:00
Pig Monkey
96d064f788 add x86_energy_perf_policy for tlp 2017-11-15 10:19:49 -08:00
Pig Monkey
f1404b3b11 shellcheck cleanup 2017-07-01 12:24:28 -07:00
Pig Monkey
1bf70b9235 consider total capacity of all batteries 2017-07-01 12:21:21 -07:00
Pig Monkey
369ff7f6b6 enable two/three finger touchpad click
https://wayland.freedesktop.org/libinput/doc/latest/clickpad_softbuttons.html#clickfinger
2017-01-15 13:20:12 -08:00
Pig Monkey
f1b742c6e7 move bluetooth masking to bluetooth role 2017-01-14 17:47:34 -08:00
Pig Monkey
58ace3aa97 disable bluetooth 2016-09-15 18:48:41 -07:00
Pig Monkey
32a82f3ae0 remove megarole dependency 2016-09-11 13:17:42 -07:00
Pig Monkey
7f7f454812 remove usb driver blacklist
Apparently this option is no longer supported, but input devices are
still excluded.
2016-09-11 13:15:02 -07:00
Pig Monkey
b84bf8b286 update tlp comments
Copying these over from the latest default makes it easier to diff our
changes.
2016-09-11 13:13:56 -07:00
Pig Monkey
a9e053dc5a enable PCI power management
The internet says this sometimes causes problems with shutdown/reboot,
but things seem to be ok with the x260 so far...
2016-09-11 13:08:52 -07:00
Pig Monkey
78a51525af notify the specified user on low battery 2016-02-20 13:19:17 -08:00
Pig Monkey
5c9f6902f0 use a timer to poll for battery state
Existing users should remove the old udev rules.

    # rm /etc/udev/rules.d/99-lowbat.rules

notify-send doesn't work since the script is being called as root, but
that is fixable. This at least gets the low battery notification via
wall and suspension at critical levels working consistently, unlike the
unreliable udev approach.
2016-02-14 17:02:43 -08:00
Pig Monkey
a71ce2b0cf merge tlp package tasks 2016-01-30 16:17:47 -08:00
Pig Monkey
48912b59db add handlers
This should mostly eliminate the need to manually reload/restart
services (or reboot the machine) after updates.
2016-01-30 16:01:47 -08:00
Pig Monkey
499cc7463b reorganize lowbatt script
Check for status and only continue if the battery is discharging.
2016-01-30 13:33:43 -08:00
Pig Monkey
479312353d fix rfkill masking
I think I originally got this from the official TLP docs, but
systemd-rfkill isn't a template, so we don't actually want the @ in
there.

Fixes some of #18.
2016-01-29 08:37:45 -08:00
Pig Monkey
48c3184c9b refactor low battery handling
udev was not distinguishing between multiple batteries. It was
suspending the system when the secondary battery reached the threshold,
even if the primary battery was still full, which is not the desired
behaviour.

There may be a way to tell udev which battery we care about, but it was
easier for me to just write a shell script that handles all the logic.
The script warns when the primary battery is low and suspends when the
primary battery is critical.

I tried calling the script with a single udev rule with a capacity range
of 0-10, however that resulted in no warnings and suspending only when
the battery went to 0%. Not useful. With two rules with different ranges
like this, the system is consistently suspended at 5%, which is what I
want. I sometimes get warnings in the 6-10% range, but not consistently.
I don't know why.

If the warnings won't work, we could create a systemd timer to call the
script every ~60 seconds or so. That will definitely work, but it seems
like udev should be able to handle this.
2016-01-28 22:25:29 -08:00