udev: Set permissions for reading proximity sensor

and changing their threshold values

Signed-off-by: Stacy Harper <contact@stacyharper.net>
This commit is contained in:
Zach DeCook
2022-04-21 01:18:52 -04:00
committed by Stacy Harper
parent 25c98dd98c
commit 722649e8aa

View File

@@ -9,6 +9,14 @@ ACTION=="add|change", SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT_TA
#ACTION=="add|change", SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT_TABLET}=="1", ENV{LIBINPUT_CALIBRATION_MATRIX}="-1 0 1 0 -1 1"
#ACTION=="add|change", SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_PATH}=="platform-fe5a0000.i2c", ENV{LIBINPUT_CALIBRATION_MATRIX}="-1 0 1 0 -1 1"
# Proximity Sensor
## Set event thresholds
ACTION=="add", SUBSYSTEM=="iio", TEST=="in_proximity_raw" RUN+="/bin/chgrp input /sys$devpath/events/in_proximity_thresh_falling_value /sys$devpath/events/in_proximity_thresh_rising_value"
ACTION=="add", SUBSYSTEM=="iio", TEST=="in_proximity_raw" RUN+="/bin/chmod g+rw /sys$devpath/events/in_proximity_thresh_falling_value /sys$devpath/events/in_proximity_thresh_rising_value"
## Read device to monitor event
ACTION=="add", SUBSYSTEM=="iio", TEST=="in_proximity_raw" RUN+="/bin/chgrp input $devnode"
ACTION=="add", SUBSYSTEM=="iio", TEST=="in_proximity_raw" RUN+="/bin/chmod g+r input $devnode"
# taken from https://github.com/haikarainen/light/blob/master/90-backlight.rules
ACTION=="add", SUBSYSTEM=="backlight", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"