Add pkg to activate acer battery health mode

This commit is contained in:
Julian Mutter 2025-04-22 21:30:05 +02:00
parent 1e4d267ce7
commit c18b1a7341
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,28 @@
{
writeShellApplication,
insmod,
}:
writeShellApplication {
name = "acer-battery-health-mode";
runtimeInputs = [ insmod ];
text = ''
#/usr/bin/env sh
# Using following tool https://github.com/frederik-h/acer-wmi-battery.git
PROJECT_LOCATION=~/git/acer-wmi-battery
if [ "$1" == "enable" ]; then
sudo insmod "$PROJECT_LOCATION/acer-wmi-battery.ko" enable_health_mode=1
echo "Battery health mode enabled"
elif [ "$1" == "disable" ]; then
sudo insmod "$PROJECT_LOCATION/acer-wmi-battery.ko" enable_health_mode=0
echo "Battery health mode disabled"
else
echo "Please either state 'enable' or 'disable'"
fi
'';
}

View File

@ -13,4 +13,5 @@
pulseaudio-popup = pkgs.callPackage ./pulseaudio-popup { };
sos = pkgs.callPackage ./sos { };
xwacomcalibrate = pkgs.callPackage ./xwacomcalibrate { };
acer-battery-health-mode = pkgs.callPackage ./acer-battery-health-mode { };
}