Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADD set backlight brightness according to time of day/sun #423

Open
allanlaal opened this issue May 18, 2022 · 3 comments
Open

ADD set backlight brightness according to time of day/sun #423

allanlaal opened this issue May 18, 2022 · 3 comments
Labels
feature request New functionality that is wished for
Milestone

Comments

@allanlaal
Copy link

Details about the problem

I want the kb backlight to correspond on how bright it is outside to increase usability

since there isn't a brightness sensor in my kb, its best to set this using sun times (I live in scandinavia, so we don't have fixed sunset/sunrise times)

good library: https://github.com/risacher/sunwait

@allanlaal allanlaal added the bug Faults with Polychromatic itself label May 18, 2022
@lah7 lah7 added feature request New functionality that is wished for feedback Opinion and thoughts to be taken on-board support Troubleshooting and help and removed bug Faults with Polychromatic itself feature request New functionality that is wished for feedback Opinion and thoughts to be taken on-board labels May 19, 2022
@lah7
Copy link
Member

lah7 commented May 19, 2022

Thanks for the suggestion. That would be a good enhancement for the planned "Triggers" feature. To start with, I was thinking based on time (#272).

sunwait appears to be a C++ program, not a Python library. It seems like it can be used by creating a simple brightness.sh script and making this run as soon as you login (in "Startup Applications") like so:

#!/bin/bash
while true
do
    sunwait wait rise
    polychromatic-cli -o brightness -p 80
    sunwait wait set
    polychromatic-cli -o brightness -p 30
done

☝🏼 That would run as a loop endlessly in the background.

@apprehensions
Copy link

Isn't the correct Bash syntax this?

while true; do
    sunwait wait rise
    polychromatic-cli -o brightness -p 80
    sunwait wait set
    polychromatic-cli -o brightness -p 30
done

?
You can also substitute true with :

@lah7
Copy link
Member

lah7 commented May 30, 2022

Yes, good catch, thanks! Yours is correct. I got confused with Python's syntax. I've edited my comment to fix up.

@lah7 lah7 removed the support Troubleshooting and help label May 1, 2023
@lah7 lah7 added this to the Triggers milestone May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New functionality that is wished for
Projects
None yet
Development

No branches or pull requests

3 participants