[presets] add steamos files

This commit is contained in:
Philip Mueller
2023-07-03 14:31:13 +02:00
parent e4c9ded69f
commit 689751f754
86 changed files with 14172 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
#!/bin/bash
set -eu
if [[ $EUID -ne 0 ]];
then
exec pkexec --disable-internal-agent "$0" "$@"
fi
WRITE_PATH="$1"
WRITE_VALUE="$2"
function CommitWrite()
{
echo "commit: $WRITE_VALUE -> $WRITE_PATH" | systemd-cat -t p-steamos-priv-write -p warning
echo "$WRITE_VALUE" > "$WRITE_PATH"
chmod a+w "$WRITE_PATH"
exit 0
}
function DeclineWrite()
{
echo "decline: $WRITE_VALUE -> $WRITE_PATH" | systemd-cat -t p-steamos-priv-write -p err
echo "$WRITE_VALUE" > "$WRITE_PATH"
exit 1
}
echo "checking: $WRITE_PATH" | systemd-cat -t p-steamos-priv-write -p warning
if [[ "$WRITE_PATH" == /sys/class/backlight/*/brightness ]]; then
CommitWrite
fi
if [[ "$WRITE_PATH" == /sys/class/drm/card*/device/power_dpm_force_performance_level ]]; then
CommitWrite
fi
if [[ "$WRITE_PATH" == /sys/class/drm/card*/device/pp_od_clk_voltage ]]; then
CommitWrite
fi
if [[ "$WRITE_PATH" == /sys/class/hwmon/hwmon*/power*_cap ]]; then
CommitWrite
fi
if [[ "$WRITE_PATH" == /sys/devices/platform/*/*/*/iio:device*/in_illuminance_integration_time ]]; then
CommitWrite
fi
if [[ "$WRITE_PATH" == /sys/devices/*/*/*/*/hwmon/hwmon*/led_brightness ]]; then
CommitWrite
fi
if [[ "$WRITE_PATH" == /sys/devices/*/*/*/*/hwmon/hwmon*/content_adaptive_brightness ]]; then
CommitWrite
fi
DeclineWrite