enable HDR (maybe)

This commit is contained in:
2025-08-18 20:59:21 +02:00
parent f68a8428f2
commit 15e19b87fe
7 changed files with 77 additions and 15 deletions

45
.scripts/hypr-sdrbrightness.py Executable file
View File

@@ -0,0 +1,45 @@
#!/usr/bin/env python3
# new_brightness="$1"
# [ -z "$1" ] && new_brightness=1
# sed -i "/sdrbrightness/c\ sdrbrightness = $new_brightness" <filename>
import sys
import os
if __name__ == "__main__":
if len(sys.argv) != 2:
new_brightness = 1
else:
try:
new_brightness = float(sys.argv[1])
if new_brightness < 1 or new_brightness > 1.5:
raise ValueError()
except Exception as e:
new_brightness = 1
print(f"Setting SDR brightness to: {new_brightness}\n")
config_path = os.path.expanduser("~/.config/hypr/hyprland/monitors.conf")
if not os.path.exists(config_path):
print(f"Configuration file {config_path} does not exist.")
sys.exit(1)
with open(config_path, 'r') as file:
lines = file.readlines()
for line in lines:
if "sdrbrightness" in line:
old_line = line.strip()
new_line = f" sdrbrightness = {new_brightness}\n"
lines[lines.index(line)] = new_line
print(f"Updated: {old_line} to {new_line.strip()}\n")
break
with open(config_path, 'w') as file:
file.writelines(lines)
print(f"New {config_path} content: \n")
with open(config_path, 'r') as file:
print(file.read())

5
.scripts/mpv-hdr Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/sh
export ENABLE_HDR_WSI=1
mpv --vo=gpu-next --target-colorspace-hint --gpu-api=vulkan --gpu-context=waylandvk "$@"

View File

@@ -14,5 +14,5 @@ if type -q zoxide
end
if type -q trash
alias rm="echo \"use 'trash' instead :)\" && sh -c \"exit 42\""
alias rm="echo \"use 'trash' instead :)\" && sh -c \"exit 42\" && echo why do you see this line :O"
end

View File

@@ -17,7 +17,7 @@ listener {
on-resume = hyprctl dispatch dpms on
}
listener {
timeout = 540 # 9mins
on-timeout = $suspend_cmd
}
#listener {
# timeout = 540 # 9mins
# on-timeout = $suspend_cmd
#}

View File

@@ -4,3 +4,4 @@ source=~/.config/hypr/hyprland/general.conf
source=~/.config/hypr/hyprland/rules.conf
source=~/.config/hypr/hyprland/colors.conf
source=~/.config/hypr/hyprland/keybinds.conf
source=~/.config/hypr/hyprland/monitors.conf

View File

@@ -1,13 +1,3 @@
# MONITOR CONFIG
monitor=,preferred,auto,1
monitor=eDP-1,2560x1600@240,auto,1.25,bitdepth,10
monitor=eDP-2,2560x1600@240,auto,1.25,bitdepth,10
# monitor=,addreserved, 0, 0, 0, 0 # Custom reserved area
# HDMI port: mirror display. To see device name, use `hyprctl monitors`
# monitor=HDMI-A-1,1920x1080@60,1920x0,1,mirror,eDP-1
input {
# Keyboard: Add a layout and uncomment kb_options for Win+Space switching shortcut
kb_layout = de
@@ -186,3 +176,6 @@ xwayland {
# disable_logs = false
# }
experimental {
xx_color_management_v4 = true
}

View File

@@ -0,0 +1,18 @@
# MONITOR CONFIG
monitor=,preferred,auto,1
# monitor=eDP-1,2560x1600@240,auto,1.25,bitdepth,10
monitor=eDP-2,2560x1600@240,auto,1.25,bitdepth,10
monitorv2 {
output = eDP-1
mode = 2560x1600@240
scale = 1.25
bitdepth = 10
# comment out following lines to disabled HDR
supports_wide_color = true
supports_hdr = true
cm = hdr
sdrbrightness = 1.4
}