Skip to content

Commit

Permalink
feat(udev): add udev rule for promptless charing threshold changes (T…
Browse files Browse the repository at this point in the history
…hinkPads only)

Allows user to modify the battery charge thresholds without password prompt. The rule was copied from [marcosdalvarez/thinkpad-battery-threshold-extension](https://gitlab.com/marcosdalvarez/thinkpad-battery-threshold-extension).
  • Loading branch information
ispanos authored Dec 21, 2023
1 parent a20eb9c commit fd4c7d4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions files/etc/udev/rules.d/99-thinkpad-thresholds-udev.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Change the permissions of the battery threshold attributes so that they can be modified by ordinary users
# See https://gitlab.com/marcosdalvarez/thinkpad-battery-threshold-extension

ACTION=="add|change", KERNEL=="BAT[0-1]", SUBSYSTEM=="power_supply", TEST{0002}!="/sys%p/charge_control_start_threshold", RUN+="/bin/chmod 666 /sys%p/charge_control_start_threshold"
ACTION=="add|change", KERNEL=="BAT[0-1]", SUBSYSTEM=="power_supply", TEST{0002}!="/sys%p/charge_control_end_threshold", RUN+="/bin/chmod 666 /sys%p/charge_control_end_threshold"
ACTION=="add|change", KERNEL=="BAT[0-1]", SUBSYSTEM=="power_supply", TEST{0002}!="/sys%p/charge_start_threshold", RUN+="/bin/chmod 666 /sys%p/charge_start_threshold"
ACTION=="add|change", KERNEL=="BAT[0-1]", SUBSYSTEM=="power_supply", TEST{0002}!="/sys%p/charge_stop_threshold", RUN+="/bin/chmod 666 /sys%p/charge_stop_threshold"

0 comments on commit fd4c7d4

Please sign in to comment.