[presets] update steam module

This commit is contained in:
Philip Mueller
2023-06-24 23:48:55 +02:00
parent 391c5d0cc1
commit 5b03b592fe
12 changed files with 269 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
#!/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
chmod a+w "$WRITE_PATH"
echo "$WRITE_VALUE" > "$WRITE_PATH"
exit 0
}
function DeclineWrite()
{
echo "decline: $WRITE_VALUE -> $WRITE_PATH" | systemd-cat -t p-steamos-priv-write -p err
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/devices/*/*/*/*/hwmon/hwmon*/led_brightness ]]; then
CommitWrite
fi
if [[ "$WRITE_PATH" == /sys/devices/*/*/*/*/hwmon/hwmon*/content_adaptive_brightness ]]; then
CommitWrite
fi
DeclineWrite