I am putting together my first python desktop app and am integrating the scripts I made for automating stuff/convenience into said program.
In bash, I use xrandr to adjust my gamma values like this
xrandr --output DP-0 --brightness 1 #brightness 100%
xrandr --output DP-0 --brightness 0.5 #brightness 50%
I'd like to use a library if possible and would love to not have to install additional software. I will take anything if thats needed though.
I'm searching for the equivalent to insert into my python script/application but I cant find it. Google only shows how to do it on windows, how to do it on laptops, how to adjust it in photos and so on and so forth.
Update: I have now found python-xlib and this code:
def set_brightness(output, brightness):
d = display.Display()
s = d.screen()
root = s.root
net_wm_state = d.intern_atom('_NET_WM_STATE',0)
atom = d.intern_atom('_NET_WM_STATE_FULLSCREEN',0)
root.xrandr(output, brightness)
output_name = "DP-0"
brightness_value = 1
set_brightness(output_name, brightness_value)
But it throws and error:
AttributeError: 'Window' object has no attribute 'xrandr'
Ich checked for an extension libXrandr but it seems to only be available in C and VScode shows
ERROR: Could not find a version that satisfies the requirement libXrandr (from versions: none)
ERROR: No matching distribution found for libXrandr
Any ideas?