sunsetr icon indicating copy to clipboard operation
sunsetr copied to clipboard

Adjust Temperature/Gamma from CLI?

Open Jack-Chronicle opened this issue 5 months ago • 4 comments

Not sure if this is already a thing or not, but would really love to either have it added or for someone to help me figure out how to do it I'm wanting to bind my brightness keys to run a command that increases or decreases the screen temperature when holding down Shift

something like this Shift+XF86MonBrightnessUp = "hyprsunsetr set temp +100" Shift+XF86MonBrightnessDown = "hyprsunsetr set temp -100"

I don't know if that would be something that could be easily added or is already possible somehow though It wouldn't need to override the existing preset schedules, just be a temporary adjustment until the next scheduled preset occurs

Jack-Chronicle avatar Nov 27 '25 22:11 Jack-Chronicle

Currently, you are able to use the set command to change temperature and gamma: https://psi4j.github.io/sunsetr/commands/get-set.html#using-the-set-command

I was considering adding incrementing and decrementing commands for temp/gamma. The issue with this is that sunsetr uses the toml config files (default and presets) as the authoritative source for what runtime state should be interpolated, so adding these commands would require doing something similar to what the set command already does.

What might work is extending the set command so that you can do something like this:

sunsetr set night_temp+=100 night_gamma+=10

This would save the setting to your active preset/default. The reason I haven't implemented this yet is because the test command already provides a good way to test the values you might find suitable and then you can set them to presets you can call. For instance, I have two presets I use darker and darkest, which sets the temp/gamma values deeper into the night appropriate spectrum:

# darker preset
night_temp = 2333        # Color temperature during night (1000-20000) Kelvin
night_gamma = 70         # Gamma percentage for night (10-100%)
# darkest preset
night_temp = 1333        # Color temperature during night (1000-20000) Kelvin
night_gamma = 60         # Gamma percentage for night (10-100%)

Another issue is that if you're in the middle of a sunset/sunrise transition and you increment/decrement the temp/gamma values, it will not actually be at the set values until it's fully in night mode, though it may interpolate noticeably darker/lighter or warmer/cooler depending on the configuration. sunsetr's gamma control doesn't control actual monitor brightness the way the x86 brightness commands do and is inherently different from this.

If you find that the existing preset system isn't quite what you need, I can add the incrementing/decrementing capability on the next release, though it will have the stated limitations. Hope this helps. You can look at how to set up presets at: https://psi4j.github.io/sunsetr/presets/index.html

psi4j avatar Nov 27 '25 23:11 psi4j

the set command with relative adjustments should work good enough, especially with some scripting to check the active preset and it's value, then change a "temp" preset to the adjusted value before setting it to the active one

Though the commands don't seem to be working for me

Invalid TOML syntax for field 'night_temp+'

Jack-Chronicle avatar Nov 28 '25 02:11 Jack-Chronicle

Though the commands don't seem to be working for me

Invalid TOML syntax for field 'night_temp+'

Sorry, this particular functionality doesn't yet exist. I was saying that I could implement something like this for the next release. Currently, you can only use the set command as it is outlined in the docs.

especially with some scripting to check the active preset and it's value

The status command can provide this for you: https://psi4j.github.io/sunsetr/commands/status.html

Or if you want, you can use the IPC directly: https://psi4j.github.io/sunsetr/advanced/ipc.html

psi4j avatar Nov 28 '25 03:11 psi4j

oh, didn't know there was an IPC! That will make it much easier, thanks for letting me know!

Jack-Chronicle avatar Nov 28 '25 03:11 Jack-Chronicle