Add pkg to activate acer battery health mode
This commit is contained in:
parent
1e4d267ce7
commit
c18b1a7341
28
pkgs/acer-battery-health-mode/default.nix
Normal file
28
pkgs/acer-battery-health-mode/default.nix
Normal 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
|
||||
'';
|
||||
}
|
@ -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 { };
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user