Add comprehensive documentation for Lenovo ThinkPad Gentoo Linux setup including: - Complete system configuration guides (power, Bluetooth, WiFi, audio) - Hardware setup documentation (touchpad, touchscreen, DisplayLink) - Management scripts with ZSH completions - Kernel configuration (6.12.41-gentoo-x86_64) - Lid automation and monitor management - Battery conservation system - User guides and troubleshooting Repository includes .gitignore to exclude logs, temporary files, and secrets. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
44 lines
1.1 KiB
Plaintext
Executable File
44 lines
1.1 KiB
Plaintext
Executable File
#!/sbin/openrc-run
|
|
# OpenRC init script for battery charge thresholds
|
|
# Restore battery charge thresholds on boot
|
|
|
|
description="Set battery charge thresholds for battery health"
|
|
|
|
BATTERY="${BATTERY:-BAT0}"
|
|
START_THRESHOLD="${START_THRESHOLD:-20}"
|
|
END_THRESHOLD="${END_THRESHOLD:-80}"
|
|
|
|
depend() {
|
|
need localmount
|
|
}
|
|
|
|
start() {
|
|
ebegin "Setting battery charge thresholds"
|
|
|
|
if [ ! -d "/sys/class/power_supply/$BATTERY" ]; then
|
|
eerror "Battery $BATTERY not found"
|
|
eend 1
|
|
return 1
|
|
fi
|
|
|
|
if [ ! -f "/sys/class/power_supply/$BATTERY/charge_control_start_threshold" ]; then
|
|
eerror "Battery charge thresholds not supported"
|
|
eend 1
|
|
return 1
|
|
fi
|
|
|
|
# Set start threshold
|
|
echo "$START_THRESHOLD" > "/sys/class/power_supply/$BATTERY/charge_control_start_threshold"
|
|
|
|
# Set end threshold
|
|
echo "$END_THRESHOLD" > "/sys/class/power_supply/$BATTERY/charge_control_end_threshold"
|
|
|
|
einfo "Battery thresholds set: ${START_THRESHOLD}% - ${END_THRESHOLD}%"
|
|
eend $?
|
|
}
|
|
|
|
stop() {
|
|
# Nothing to do on stop
|
|
return 0
|
|
}
|