helloSystem / Utilities

Utilities written in PyQt5, meant for use with helloSystem
BSD 2-Clause "Simplified" License
28 stars 29 forks source link

Proposal for brightness control #44

Open PreyK opened 3 years ago

PreyK commented 3 years ago

Hello!

I'm a long-time laptop user and just installed HelloSystem on my secondary laptop and already absolutely love the user-experience. However, I really needed some finer options for brightness control so I just started making an application for it. If PR-s for system applications are welcome I'd love to contribute this back when I meet the design goals described below. Below is my proposal for a brightness control application, currently it's just a draft, any opinion, feedback, design consideration is most welcome!

What do I have currently: (youtube video) IMAGE ALT TEXT HERE

A simple PyQt application in a .app format that adds a brightness control slider to the menu bar. I'd like to extend this further as I have some ideas from a user-experience standpoint.

My design goals:

This always bugged me on everything. On windows, if I ever plug in my laptop the brightness immediately changes and I have to set it again. On some Linux distros if I go to sleep the brightness just resets.

Why? What changed that warrants a changed brightness in this case? Like I know I can use more power but I already set my preferred brightness, don’t ever change it! If I would want different brightness I will set it because I as the user know what I want and already set it. It’s just following the philosophy of the system completely getting out of your way and letting you do your stuff.

I guess this is a remainder from yesteryear’s laptops when screen brightness was considered a luxury from a power point of view. But we are in 2021, now we have laptops with 12-24 hours of battery life, and even on low-end/older models we have at least 6-10 ish, and new batteries for older laptops are very cheap (30-60 $ ish on eBay and repair shops). I think if a user would still like to use their old laptop it's very likely that they do a battery swap at least one point in the product's lifecycle if they are seriously daily driving it.

It would be awesome to get some second opinion regarding this (brightness never changing on plug/unplug) for design considerations.

The ideal brightness control application:

Features I'd love to experiment with if PR-s are welcome, the project gets accepted, and meets its described design goals:

Realtime histogram-based adaptive brightness: Okay, I know how this might sound at first but hear me out. Imagine you are home at night, all the lights are off and you are reading some stuff on your laptop from the bed. Suddenly you open another application/web page with a really bright/white background and your eyes go up in eternal flames. alt text I'm sure at least some laptop users can relate, It happened to me too many times :D

I come from the game-dev industry we already worked out a solution for going into really bright places from the dark and dynamic/drastic changes to the lighting. In fact, since Half-Life 2 almost every AAA game uses it. It's called Auto-Exposure or sometimes eye-adaptation. https://docs.unrealengine.com/en-US/RenderingAndGraphics/PostProcessEffects/AutomaticExposure/index.html

You might have even heard of it or have some bad experiences with it. Yes, it's a hard task, if done wrong it can cripple the user experience drastically. But when it's done right (for example in some video games) you just don't even notice it. On the desktop, we don't have real-time 3D objects and lighting but we do have dynamic and rich applications/content that can drastically change the colors displayed on the screen. Following the thought experiment of John Carmack of Oculus when designing display tech (take manufacturer specs, not as specs but recommendation) we could totally use a system like this for the desktop.

The whole idea of it is that when there's a change in the perceived brightness level our eyes (or in the case of video games the camera) have to adopt. What if we could do something that our eyes don't have to but the screen's brightness adapts automatically so that the perceived brightness would always be approximately the same? This could drastically reduce eye-strain for people who spend 10-12 hours near screens and in theory, make a way more natural user experience for the desktop. Or even a next-gen night mode that doesn't just makes your display yellow but actually doing something. Maybe even an option where the user doesn't set the exact brightness but the perceived brightness and the backlight adjusts automatically to the set perceived brightness levels.

Enviroment based adaptive brightness: This is a well-known one. We already have this on all apple machine, all iPhones, most of our phones and tablets.. etc Basically, if you go out into sunlight or switch on/off the light indoors, a light sensor automatically detects the change in brightness and the display set's the brightness in a way that you can see the screen and or it's not too bright. Since on changes to the environmental lighting your eyes have to adapt anyway we could just make it easier for the user and dynamically adapt with the lighting.

The main problem is that we don't really have light sensors in every laptop and even if we had the drivers can be problematic. But we have the next best thing on like 90% of the laptops. A web camera. Yes I know, users really don't like when an application constantly uses their web camera, some even tape it off. But we don't even have to get a clear picture of the camera, we would totally be fine with a really low-res or even blurry image, all we need it for is to just compute some brightness from a histogram. I'm not really sure how I would work this out from a user experience standpoint, obviously using the camera all the time is not a good solution but would love to experiment with this too.

Anyway, this was a long one, thanks for reading, and thanks to everyone who worked on this so far! :D If it's something that would be a great fit for HelloSystem do let me know :)

probonopd commented 3 years ago

hello @PreyK

Yes, PRs for system applications, utilities, and preferences are definitely highly welcome.

Fully agree that the brightness should not "arbitrarily" change. For the same reason, I always disable the automatic brightness controls on mobile devices, because most of the time the sensors get it wrong anyway. I know for sure that I would not want the camera on my notebook to be switched on except for e.g., video calls.

I am not sure we really need something that is running all the time just to control the brightness. (Processes that run all the time consume memory all the time.) Wouldn't a "less bright" and "brighter" key on the keyboard do the job? E.g., "less bright" on F1 and "brighter" on F2, or Ctrl-F1 and Ctrl-F2, respectively (like on the Mac)?

So I'd say lets start by making those keys work properly, and then maybe go further from there if really needed.

PreyK commented 3 years ago

Finally someone agrees on that unplugging a cord should't change the brightness :+1: Yes, good point on the keyboard stuff, I guess 99% of the time that would be all anyone would need. Just got carried away on this :D

probonopd commented 3 years ago

In helloSystem, we are always looking for the simplest, most lightweight viable solution (but not simpler than that!) ;-)

grahamperrin commented 3 years ago

Gammy

Adaptive screen brightness and temperature. For Windows and Linux.

https://www.freshports.org/accessibility/gammy/#history

I should describe Gammy as a must-have for many FreeBSD hardware environments.


Prior to Gammy, I relied upon the /usr/local/bin/lxqt-config-brightness part of sysutils/lxqt-config.

grahamperrin commented 3 years ago

https://github.com/helloSystem/Utilities/issues/44#issuecomment-777837125

Ctrl-F2,

Beware of keyboard conflicts.