-
Notifications
You must be signed in to change notification settings - Fork 154
Expand file tree
/
Copy pathtlp.rules.in
More file actions
18 lines (15 loc) · 1.11 KB
/
Copy pathtlp.rules.in
File metadata and controls
18 lines (15 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# tlp - udev rules
#
# Copyright (c) 2026 Thomas Koch <linrunner at gmx.net> and others.
# SPDX-License-Identifier: GPL-2.0-or-later
# handle power source events:
# - AC/Mains charger
ACTION=="change", SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_TYPE}=="Mains", RUN+="@TLP_SBIN@/tlp auto %k"
# - Battery (ignore input device batteries identified by device name "hidpp_battery*")
ACTION=="change", SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_TYPE}=="Battery", KERNEL!="hidpp_battery*", RUN+="@TLP_SBIN@/tlp auto %k"
# - USB-C charger (ignore invalid transient states identified by charge_type "Unknown")
ACTION=="change", SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_TYPE}=="USB", ENV{POWER_SUPPLY_CHARGE_TYPE}!="Unknown", RUN+="@TLP_SBIN@/tlp auto %k"
# handle added usb devices (exclude subdevices via DRIVER=="usb")
ACTION=="add", SUBSYSTEM=="usb", DRIVER=="usb", ENV{DEVTYPE}=="usb_device", RUN+="@TLP_ULIB@/tlp-usb-udev usb %p"
# handle added usb disk devices (exclude partitions via ENV{DEVTYPE}=="disk")
ACTION=="add", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", ENV{ID_USB_TYPE}=="disk", RUN+="@TLP_ULIB@/tlp-usb-udev disk %p"