enable HDR (maybe)
This commit is contained in:
45
.scripts/hypr-sdrbrightness.py
Executable file
45
.scripts/hypr-sdrbrightness.py
Executable 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
5
.scripts/mpv-hdr
Executable 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 "$@"
|
||||
Reference in New Issue
Block a user