HDR-Helper v1.1.0.0 WIP

-Implemented experimental HDR brightness control.
This commit is contained in:
2025-01-01 01:29:40 +00:00
parent 3a4af3aedd
commit 1630d00ec0
2 changed files with 29 additions and 7 deletions
+24 -4
View File
@@ -1,10 +1,9 @@
#!/bin/bash
_VERSION=1.1.0.0
CONFIG_FILE="$HOME/.config/hdr-helper/monitor.conf"
MONITOR= # MODIFY THESE VALUES INSIDE MONITOR.CONF #
NATIVE_RES= ###########################################
TEMP_RES= ###########################################
CONFIG_PATH="$HOME/.config/hdr-helper/"
CONFIG_FILE="$CONFIG_PATH/monitor.conf"
CONFIG_CURR_BRIGHTNESS="$CONFIG_PATH/current-brightness-level"
show_hdr_status() {
ICON="/usr/share/icons/breeze-dark/devices/64/monitor.svg"
@@ -16,6 +15,25 @@ show_hdr_status() {
fi
}
set_brightness() {
if [ "$HDR_TARGET_BRIGHTNESS" -gt 0 ]; then
kscreen-doctor -o | \
grep Brightness | \
head -n 1 | \
sed 's/.*set to \([0-9]\+\)%.*/\1/' \
> $CONFIG_CURR_BRIGHTNESS
echo "DEBUG: TARGET BRIGHTNESS" $HDR_TARGET_BRIGHTNESS
kscreen-doctor output.$MONITOR.brightness.$HDR_TARGET_BRIGHTNESS
fi
}
restore_brightness() {
if [ -f $CONFIG_CURR_BRIGHTNESS ]; then
echo "Debug: CURRENT BRIGHTNESS" $(cat $CONFIG_CURR_BRIGHTNESS)
kscreen-doctor output.$MONITOR.brightness.$(cat $CONFIG_CURR_BRIGHTNESS)
fi
}
refresh_display() {
kscreen-doctor output.$MONITOR.mode.$TEMP_RES
kscreen-doctor output.$MONITOR.mode.$NATIVE_RES
@@ -25,11 +43,13 @@ refresh_display() {
enable_hdr () {
kscreen-doctor output.$MONITOR.hdr.enable
refresh_display
set_brightness
}
disable_hdr() {
kscreen-doctor output.$MONITOR.hdr.disable
refresh_display
restore_brightness
}
auto_hdr() {