Date created: Tuesday, January 23, 2024 8:42:46 AM. Last modified: Thursday, June 20, 2024 9:20:04 AM
Thinkpad Notes
Battery and Power
# Set start and stop charging thresholds
$ vi /etc/tlp.conf
START_CHARGE_THRESH_BAT0=75
STOP_CHARGE_THRESH_BAT0=80
See "man tlp" for applying the config.
power stats
power () { bat_energy_now=$(cat /sys/class/power_supply/BAT0/energy_now) bat_energy_full=$(cat /sys/class/power_supply/BAT0/energy_full) bat_capacity=$(cat /sys/class/power_supply/BAT0/capacity) bat_start_chrg=$(cat /sys/class/power_supply/BAT0/charge_control_start_threshold) bat_stop_chrg=$(cat /sys/class/power_supply/BAT0/charge_control_end_threshold) ac_online=$(cat /sys/class/power_supply/AC/online) echo -n "Battery energy (${bat_energy_full}/${bat_energy_now}): " echo "(${bat_energy_now}/${bat_energy_full})*100" | bc -l echo "Battery capacity: ${bat_capacity}%" echo "Start charge %: ${bat_start_chrg}" echo "Stop charge %: ${bat_stop_chrg}" echo "AC connected: ${ac_online}" } $ power Battery energy (56970000/45650000): 80.12989292610145690700 Battery capacity: 80% Start charge %: 90 Stop charge %: 100 AC connected: 1
Disks
# List disks
$ tlp diskid
Screen
# Brightness on T13
$ cat /sys/class/backlight/intel_backlight/brightness
# Brightness on T14
$ cat /sys/class/backlight/amdgpu_bl0/brightness
Previous page: NUMA, Multi-Queue NICs and CPU Affinity
Next page: Ansible Notes