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 blue light filter to tweaks #1134

Merged
merged 69 commits into from Dec 11, 2023
Merged

Add blue light filter to tweaks #1134

merged 69 commits into from Dec 11, 2023

Conversation

XK9274
Copy link
Member

@XK9274 XK9274 commented Aug 28, 2023

Overview

Menu Options

Features

  • Blue light function to change the colortemp of the screen
  • Fades in/out
  • Time scheduling
  • Selection of strengths/presets

Adds

Menu item to Tweaks -> Appearance -> Blue light filter
cmdline control over BLF through tweaks but should be used with the blue_light.sh script rather than direct control.

blue_light.sh accepts the following:
Usage: $0 {enable|disable|check}

script guards against running too often with:
/tmp/blue_light_script.lock

script will quickly complete depending on the action, will not enable BLF if it's already enabled, etc

Considerations

  • Added to 15 second loop area of keymon, there will be +/- 15 seconds after making a change to the time profiles before it actually changes.
  • Changes will be live immediately after the time is changed (even if you're still in tweaks)

Options

Colour will gradually change, has 5 preset options:

  • Subtle
  • Moderate
  • Balanced
  • Strong
  • Intense

@XK9274 XK9274 self-assigned this Sep 2, 2023
@XK9274 XK9274 marked this pull request as draft September 6, 2023 20:22
@XK9274
Copy link
Member Author

XK9274 commented Sep 6, 2023

Converting to draft to add an "auto" feature or a "set time" feature for users with NTP support enabled... soon™

@Aemiii91 Aemiii91 added this to the v4.3 milestone Sep 25, 2023
@Aemiii91 Aemiii91 added the enhancement New or improved feature label Oct 3, 2023
XK9274 and others added 7 commits November 10, 2023 17:50
Store RGB in a file
Allow tweaks to run with an arg to start the blf thread
Add blue light submenu
Add enable "now" menu item
Rework strength/enabling etc
Add schedule logic in tweaks
Add checker to keymon in the 15 second loop
Add guards into blue_light.sh
Add locking mechanism incase script gets spammed (should never happen)
@XK9274 XK9274 marked this pull request as ready for review November 11, 2023 23:04
@XK9274 XK9274 marked this pull request as draft November 12, 2023 11:55
XK9274 and others added 3 commits November 12, 2023 12:08
@XK9274 XK9274 marked this pull request as ready for review November 25, 2023 18:53
@schmurtzm schmurtzm added this pull request to the merge queue Dec 11, 2023
Merged via the queue into main with commit ada969e Dec 11, 2023
3 checks passed
@schmurtzm schmurtzm deleted the add-blue-light-filter branch December 11, 2023 23:27
@XK9274 XK9274 changed the title FEAT: Add blue light filter to tweaks Add blue light filter to tweaks Jan 6, 2024
@edmunek
Copy link
Contributor

edmunek commented Jan 9, 2024

sorry to be a pain but just noticed that using it the "intended way" is not really working.

At home. 23:00. Turned on blue filter, set the schedule that blue light filter will only apply between 22:00 and 08:00.
Next day, arrived to the office, I am not using any network connection so the MMP is offline. As it does not know what time it is (Tweaks>System>Date and time... showing it is still 0:40 am in the middle of the night), the blue filter stays on.

Might be worth mentioning somewhere that the blue filter schedule will only work (apply the schedule) when the console is connected to the internet

@XK9274
Copy link
Member Author

XK9274 commented Jan 9, 2024

sorry to be a pain but just noticed that using it the "intended way" is not really working.

At home. 23:00. Turned on blue filter, set the schedule that blue light filter will only apply between 22:00 and 08:00.
Next day, arrived to the office, I am not using any network connection so the MMP is offline. As it does not know what time it is (Tweaks>System>Date and time... showing it is still 0:40 am in the middle of the night), the blue filter stays on.

Might be worth mentioning somewhere that the blue filter schedule will only work (apply the schedule) when the console is connected to the internet

Hey, no need to apologise.

Yes this is something that's out of my hands tbh but when I write the documentation I'll make sure to add this in. Thanks!

@edmunek
Copy link
Contributor

edmunek commented Jan 9, 2024

Yes this is something that's out of my hands

no stress. that's what the beta tests are for :)

@jepyang
Copy link

jepyang commented Jan 9, 2024

I’m not sure if this is possible with how the blue light filter currently works, but by way of a feature request: any chance of a red-light only night mode? Like not just the extra-warm setting that is in the beta currently, but fully red-subpixels-only? I know it’ll make some games look seriously funky but I use this mode on my phone when I’ve got insomnia and I’m using it in pitch-black—it both avoids bothering my partner and also doesn’t trick my brain into waking up any more.

would really help me out a lot!
Thank you. (Btw the new night mode is already a great improvement, I appreciate it!)

@XK9274
Copy link
Member Author

XK9274 commented Jan 13, 2024

I’m not sure if this is possible with how the blue light filter currently works, but by way of a feature request: any chance of a red-light only night mode? Like not just the extra-warm setting that is in the beta currently, but fully red-subpixels-only? I know it’ll make some games look seriously funky but I use this mode on my phone when I’ve got insomnia and I’m using it in pitch-black—it both avoids bothering my partner and also doesn’t trick my brain into waking up any more.

would really help me out a lot!
Thank you. (Btw the new night mode is already a great improvement, I appreciate it!)

Hey hey.

Yeah it would 100% be possible. Are you thinking of say, converting all 5 presets to varied stages of red, or just having one tuned preset that would help you and others be more comfortable late at night?

If you message me on discord we can take a look at some colour values as they'd appear on the screen. _xk_

@jepyang
Copy link

jepyang commented Jan 13, 2024

Yeah, I think the other modes are great for other situations; I was just thinking of an additional red-only mode for playing in the pitch-black.

thank you very much! I’ll try to send you a ping on discord

@XK9274
Copy link
Member Author

XK9274 commented Jan 13, 2024

Yeah, I think the other modes are great for other situations; I was just thinking of an additional red-only mode for playing in the pitch-black.

thank you very much! I’ll try to send you a ping on discord

Should be very easy to add if you just want a single red flavour yup. Sure np, catch up with you later then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New or improved feature
Projects
Status: Done / Ready for release
Development

Successfully merging this pull request may close these issues.

None yet

5 participants