Giter Club home page Giter Club logo

soft-brightness's Introduction

Soft Brightness Gnome Shell Extension

Build Status

Brightness slider in Gnome Shell's system menu

Overview

Soft Brightness uses an alpha overlay to control the brightness on all or some of your monitors. It integrates smoothly and does not interfere with other Gnome Shell features. It works flawlessly with the Night Light, the Magnifier from the Accessibility Services, or with screen captures (as long as they are initiated by Gnome Shell).

Common uses are:

  • Your laptop has no back-light, maybe because it's not supported, or you have an OLED display.

  • You want to control the brightness level of external monitor like you do with your built-in screen.

Bonus features:

  • Minimum brightness level: do not get lost in the dark.

  • Can operate the shell in tear-free (VSync) mode at all time.

  • Disables itself temporarily when a screen shot is taken.

Configuration

Soft Brightness comes with a configuration panel, which can be accessed from the "Tweaks" application or the Gnome Shell Extensions page.

Soft Brightness preference panel

Configuration Settings

Use backlight control

When enabled, Soft Brightness will work together with your computer's back-light. The brightness slider and keyboard brightness hotkeys will control both the back-light and the Soft Brightness overlays. This is most useful:

  • if you have a back-light and Monitors is set to External, or

  • if a back-light is detected by Gnome but is not working (like some OLED panel laptops which report having a back-light brightness which doesn't exist). In that latter case Monitors should be set to All.

If Use backlight control is disabled, the Brightness slider will only control the Soft Brightness overlays. The keyboard brightness hotkeys will keep their default bindings.

Monitor(s)

  • If set to All, a brightness overlay will be added to all attached monitors.

  • If set to Built-in, the brightness overlay will only be added to the built-in monitor, which is the setting right below Monitor(s).

  • If set to External, a brightness overlay will only be added to all monitors which are not the built-in monitor, defined in the setting right below Monitor(s).

Built-in monitor

A list of currently attached monitors is displayed. Pick from the list which monitor should be considered the built-in monitor.

The setting only has an effect if Monitor(s) is set to Built-in or External.

Full-screen behavior

Choose one of:

  • Do not enforce brightness in full-screen: When an application enters full-screen mode, remove the brightness overlays. You may want to try this setting if your applications' refresh rate is lagging in full-screen. The application will unredirect its window and will bypass Gnome Shell's compositing (this is the default for full-screen applications in Gnome Shell unless changed by another extension).

  • Brightness enforced in full-screen: The brightness overlay stays active when an application enters full-screen mode. This also prevents the app from unredirecting its window (its surface will be composited with Gnome Shell, and as a side-effect, will be subjected to vertical refresh synchronization, ensuring tear-free rendering). This is the default.

  • Brightness enforced in full-screen, always tear-free: Works like Brightness enforced in full-screen, but will still prevent full-screen applications from unredirecting their windows even if no brightness overlay is active (brightness is 100%). Applications will then always be rendered tear-free, whatever the brightness may be. In this mode, Soft Brightness can be used as a replacement for extensions like Fix Fullscreen Tearing.

Minimum brightness

Sets the minimum allowable brightness for the display where 0 is completely dark and 1 completely bright. Defaults to 0.1 (10%).

The minimum brightness will also be enforced for the panel back-light if Use backlight control is on.

When the brightness is set to 0%, the display will go completely dark, it may be hard to reset the brightness with the slider then.

Mouse cursor brightness control

Toggles between having the mouse cursor brightness follow the screen brightness (on/true) and keeping the mouse cursor at full brightness (off/false).

Gnome Shell's handling of cursor tracking can be sometimes buggy and can show the wrong cursor type or size when the mouse cursor brightness follows the screen brightness. It also introduces some pointer motion lag.

Note that if an other Gnome Shell component enables mouse tracking (for example the Zoom accessibility option), then the mouse cursor brightness will always follow the screen's.

Debug

When toggled on, Soft Brightness will log extra debugging information to the system journal (or syslog).

This will be useful if you encounter a bug: In that case, please turn Debug on, and try to reproduce the issue with that setting before capturing the debug logging.

Soft Brightness's debug messages can be watched with:

journalctl -f | grep 'gnome-shell.*Soft-Brightness'

Effect on power consumption

Soft Brightness will cause extra load on the hardware and therefore slightly increase power usage, as it needs to add extra alpha layers and track the mouse among other things. This is true of any Gnome Shell extension.

If Soft Brightness controls an LCD panel, changing the brightness will not change at all the panel's power consumption. Use the back-light instead: Changing the back-light brightness will affect power consumption, the lower the brightness, the lower the power usage.

If Soft Brightness controls an OLED panel, changing the brightness will affect power consumption, the lower the brightness, the lower the power usage.

Common use cases and usage scenarios

You have a desktop computer

Soft Brightness can be used to control the brightness of all your attached monitors:

  • Set Use backlight control to Off.

  • Set Monitor(s) to All.

You have a laptop computer with a back-light

You can leave the control of your attached display to the back-light and use Soft Brightness to control the brightness of external displays:

  • Set Use backlight control to On.

  • Set Monitor(s) to External.

  • Configure Built-in monitor to your built-in panel's name.

You have a laptop computer without a back-light

For example an OLED panel or non-functional back-light. Have Soft-Brightness control the brightness for all your monitors:

  • Set Use backlight control to On.

  • Set Monitor(s) to All.

License

Soft Brightness is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see [http://www.gnu.org/licenses/].

Download / Install

Install directly from the Gnome Shell Extensions site.

Or download the zip file from the GitHub releases page and run:

gnome-extensions install [email protected]

Building from source

Requirements

  • meson v0.50.0 or later.

Running the build

  • Check out: git clone https://github.com/F-i-f/soft-brightness

  • cd soft-brightness

  • Run meson: meson build

  • To install in your your gnome shell extensions' directory (~/.local/share/gnome-shell/extensions), run ninja: ninja -C build install

  • To build the extension zip files, run: ninja -C build extension.zip, the extension will be found under build/extension.zip.

Changelog

Version 30

May 20, 2022

  • Support Gnome Shell 42.
  • Drop compatibility with Gnome Shell 3.32. The earliest supported version is now 3.33.90.
  • Fix version detection code to handle non-numeric versions (eg. 42.beta).
  • Fix error at startup ("TypeError: this._overlays is null").
  • Meson-gse update: Support js91, meson 0.61.
  • Cleanups.

Version 29

December 22, 2021

  • Fixed long standing issue with Mouse cursor brightness control not working on Gnome 40 and later.
  • Declare compatibility with version 40 and 41 of Gnome Shell instead of using minor versions (40.0 and 41.1). This should clear reports of the extension being incompatible with well-supported versions.
  • Drop compatibility with Gnome Shell 3.28 and 3.30 (which do not have getSettings/initTranslations in ExtensionUtils).
  • Update meson-gse:
    • Fix build issues with meson 0.60.0.
    • Bump minimum meson version to 0.50.0.
  • Clean up code:
    • Remove Lang imports.
    • Use ExtensionUtils for getSettings/initTranslations instead of using meson-gse's convenience.js.
    • Drop old Gnome Shell 3.28 compatibility code.

Version 28

December 18, 2021

  • Gnome Shell 41 compatibility.
  • Update meson-gse to latest:
    • Bug fix for preferences logging.
  • Add Dutch translation (courtesy of @Vistaus).

Version 27

March 25, 2021

  • Gnome-shell 40.0 compatibility.
  • Update preferences for Gnome-shell 40.0.
  • Disable mouse cloning on Gnome-shell 40 and later.
  • Update meson-gse to latest:
    • Now prints the GJS version in the system log at start-up (if debug is enabled).
    • Support more mozjs version (78, 68, 52) for build-time syntax checks (ninja test).

Version 26

November 12, 2020

  • Fix mouse cursor offset bug on GS 3.38.

Version 25

October 30, 2020

  • Added Persian translation.

Version 23, 24

October 29, 2020

  • Added Turkish translation.

Version 22

October 28, 2020

  • GS 3.38 compatibility: CursorSprite.set_anchor_point has been removed.

Version 21

October 8, 2020

  • Only disable mouse tracking on Gnome-Shell 3.38 when gjs 1.65 up to 1.66.0 inclusive are detected.
  • Report gjs version in log.

Version 20

October 6, 2020

  • Kludgy work-around a Gnome-Shell bug where mouse tracking doesn't generate events by delaying the mouse tracking initialization after the extension has loaded.
  • Disable mouse tracking on Gnome-Shell 3.38 until Gnome-Shell Issue #3237 is fixed.
  • Support Gnome-Shell 3.38.

Version 19

April 24, 2020

  • Add a preference for toggling mouse cloning.
  • Fix typos.
  • Update French translation.

Version 18

March 12, 2020

  • Fix Gnome-shell 3.34 cursor tracking broken on Wayland
  • Enhance cursor tracking performance regression on GS >= 3.34 introduced in version 16.

Version 17

March 11, 2020

  • Gnome-shell 3.36 compatibility.
  • Fix deprecation warning in preferences.
  • Update meson-gse to latest.

Version 16

March 10, 2020

  • Re-enable mouse cloning on Wayland GS >= 3.34.1 (work-around only active for 3.33.90 < GS < 3.34.1).
  • Added Czech translation (thanks to p-bo on GitHub).
  • Fix annoying bug on GS 3.34 where the brightness slider will creep back to 100% whenever changed to something lower (only when using backlight control).

Version 15

October 27, 2019

  • Now compatible with GS 3.34 and GS 3.35.1.
  • Do not clone mouse on GS > 3.33.90 when running under Wayland (work-around Mutter issue #826).
  • Minor code clean-ups.
  • Show GS version and session type (Wayland/X11) at start-up when debugging.

Version 14

August 21, 2019

Fixed broken version 13 update.

  • Fix slider not up-to-date at start on GS 3.33.90.
  • Fix broken GS 3.32 compatibility code.

Version 13

August 19, 2019

  • Note that this version is broken. Please use versions 12 (on Gnome-Shell 3.32 and lower), or version 14 (all Shell versions).
  • Gnome-shell 3.33 compatibility.

Version 12

April 23, 2019

  • Fix Drag-n-Drop (eg. in Overview).

Version 11

April 23, 2019

  • Fix bug where the cursor sprite changes were not tracked correctly on Gnome Shell 3.28.
  • Fix regression crash by infinite recursion when attempting to "Use backlight" without a hardware backlight. If that happens, the extension will use its internal setting for the brightness value.

Version 10

April 23, 2019

  • Fix extension errors on Gnome Shell 3.32.
  • Fix cursor disappearing when external monitors are plugged in or the Monitor(s) preference setting is changed.
  • Fix flickering on Gnome Shell 3.32 when mouse hovers non-overlaid display sections but overlays are active on other monitors.
  • Fix mouse still being tracked unnecessarily when the overlays should activate but don't because the monitors they would apply to are not connected.
  • Gnome Shell 3.28 compatibility.
  • Expand documentation.

Version 9

April 20, 2019

  • The mouse pointer is now affected by the brightness.
  • Better & simpler Magnifier handling.
  • Fix bugs.
  • Improved code maintainability.

Version 8

April 16, 2019

  • Remove the overlay during screenshots: they are now unaffected by the brightness setting.
  • Keep the brightness setting when the magnifier (aka. Universal Access Magnifier/Zoom) is on.
  • Fix bugs.

Version 7

March 30, 2019

  • Fix warning in logger.js that was introduced in version 6.

Version 6

March 26, 2019

  • ES6 / Gnome-Shell 3.32 compatibility (still compatible with 3.30 and lower).
  • Updated meson-gse to latest.
  • Minor doc updates.

Version 5

March 24, 2019

  • Updated meson-gse to latest.
  • Fix extension error on disable.
  • Fix extension error on enable-disable-enable.
  • Minor non-user visible, internal changes to preferences dialog.
  • Minor doc updates.

Version 4

February 11, 2019

  • README.md: Meson 0.44.0 or later is required.
  • README.md: Add credits.
  • Drop duplicate shipped file in lib/convenience.js.
  • Add GPLv3 in LICENSE.
  • Use meson-gse for building: custom scripts moved there.
  • Fix french translations not showing up.
  • Beautify preferences dialog.
  • Fix a few strings for consistency.
  • Fix wrong gettext-domain in schema file.
  • Remove all global variables from extension.

Version 3

February 6, 2019

  • Moved to git.
  • Use meson for builds, restructure source tree.
  • Added internationalization, and french translation.
  • Added LICENSE and README.md files.
  • Show git revision in debug logging.
  • Brightness overlays now mask the entire desktop, including transients.
  • Brightness overlays don't prevent DND actions in the overview anymore.
  • Fix a couple of typos.

Version 2

February 5, 2019

  • The extension now removes the standard brightness control and puts its own in place (as opposed to trying to monkey patch the existing control).

  • Handle external/built-in monitor.

  • Control what happens in full-screen.

Notes

The git release shows as 3 in the source code, but the extension (as built by the Gnome Shell Extensions website) shows the release at 2. Let's call it release 2 then.

Version 1

February 2, 2019

First public release.

Credits

soft-brightness's People

Contributors

f-i-f avatar mahozad avatar muhaaliss avatar p-bo avatar vistaus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

soft-brightness's Issues

Not working in Gnome 3.36

Extension version: 18
Gnome-shell version: 3.35.91
Mutter version: 3.35.91-1ubuntu1
on Ubuntu 20.04
I tried installing the latest version of the program in 3 different ways:
Through the Gnome extensions wab application
By downloading the latest release (v18) from the gitHub repository and placing it in ~/.local/share/gnome-shell
and by cloning the repository with git git clone https://github.com/F-i-f/soft-brightness.git ~/.local/share/gnome-shell/extensions/[email protected]
In none of the cases the icon is displayed in the tray bar, the extension is not listed in Extensions of Ubuntu. The application is listed in gnome tweaks but it's not possible to toggle it on, also accessing to the configuration panel is impossible.

Mouse movement lags

I'm on Ubuntu 20.04. I'm using a laptop with an external LG display via HDMI. Only the external active. Everything is updated and when I change the brightness the mouse starts to lag. Feels like the FPS drops down to 10-15.

The base brightness went very low

The 100% brightness for the gnome is not 100% any more.
I mentioned that, because switching to mate or creating another user and login to gnome has the expected brightness.
disabling or even removing, reinstalling the extension didn't help at all.
i help myself buy increasing the brightness with xrandr using sth. like

xrandr --output DVI-D-0 --brightness 2.5

But this is 100% incorrect, because making a screenshot of the monitor shows the problem clear.
I guess another value is somewhere changed, that i cant find. i investigated all values in dconf-editor without any success.

I hope anybody has an idea how to solve this problem.
Thanks in advance

Cursor Doesn't Change Type

The cursor seems to get stuck on a certain type in non-gnome applications. For examples, in Chrome and Firefox, the cursor won't change to a pointer on links. Or it will and then gets stuck as a pointer for a bit. Another, the pointer won't change to text selector when hovering over the search bar in Spotify. The cursor functions as expected despite its appearance.

The pointer changes to appropriate types in native gnome applications like the file browser, Tweaks, etc.

Using gnome 3.32.2 (arch)

Side note of thanks: just installed the FHD mod for my x230 thinkpad. To adjust brightness with this mod, a kernel or bios patch is needed. Beyond my means, so this extension is an eye-saver. Thanks!

Long-term effects on the eyes

I've been using this extension for a few months now and I find it very convenient, thanks to @F-i-f and the others dev who work on it!
I was just having a doubt, as far as my eyes and eye strain are concerned, is using this extension the same as actually lowering the screen brightness?
Instinctively I'd say no, however by setting the real screen brightness to maximum, and minimum with extension, it doesn't seem like the screen is emitting annoying light (I am using an IPS screen and an old LCD screen).
What do you think about it?
By using the computer for many hours a day, I would like to avoid over-straining my eyes. ๐Ÿ˜…

screenshots getting affected by brightness setting

I am using opensuse tumbleweed (gnome 42) with latest version of soft-brightness and screenshots get affected by brightness settings. I am also attaching screenshots at two different bightness level for comparison
Screenshot from 2022-05-03 10-24-53
Screenshot from 2022-05-03 10-26-41
.

Schedule Brightness Reduction

Maybe it's possible to define a brightness level that adjusts based on the time of the day? Or one that adjusts to Gnomes NightLight Time Settings?

Gnome 3.38 issue

When I enable soft-brightness in 3.38.1 the mouse cursor disappears.
Arch 5.4

Thanks

Pseudo cursor on the top left of the screen

During normal usage, a static mouse cursor will be displayed at the top left of the screen at random. It does not interfere with the usage of the normal cursor, however; it makes it so that there's 2 cursor on screen. I tried to take screenshot, but it disappears when my screen capture is turned on.

I've tried to collect the log as mentioned in the extension site, but I don't think there's anything of value here.

Edit*: I just realized I forgot to turn on debug. Will post the log once the bug surfaces.

Overlay covers workspace dock in overview

When brightness is turned down via Soft Brightness and thus the soft brightness overlay is enabled, I can't drag windows from one workspace to another in the overview. Functionality returns to normal when Soft Brightness is disabled.

Gnome 3.32
Soft Brightness 10

Overlay covers mouse

Recent update from Gnome Extensions causes the mouse to disappear when the overlay is activated by decreasing the brightness. Installed manually from git, same issue. I assume it's because the overlay is now covering the mouse where previously it was under the mouse.

Gnome 3.32.1

Update to Gnome 40

The extension already appears to be working, with some minor changes required to the settings menu.

I've just changed the meta data to "40.0" and it's working just fine.

gnome 40 support?

This is one of the most important extensions I use, include clipboard indicator, and shutdown timer.
Kindly make soft-brightness work with gnome 40 (fedora 34). Thanks.

Mouse Coursor invisible after login

  • I am using Extension Version 27, default settings
  • My System: $ uname -a
    Linux pc-021 5.11.0-40-generic #44~20.04.2-Ubuntu SMP Tue Oct 26 18:07:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

After the first login into Gnome, the Cursor are not visible. I have to change the Brightness in the Extension, then the Cursor shows up.

[REQ] Two stage behavior

Hello. I like this extension.
But i guess its feature to use screen dimming and backlight control isnt ideal.
Currently it does use whole slider to set both values.
My idea is to set backlight brightness in first stage (50% - 100% range), and dimming in 2nd stage (0% - 50%). (as optional feature)
0% - minimum backlight value, screeen dimmed by sw
50% - minimum backlight value, screen not dimmed by sw
100% - maximum backlight value, screen not dimmed.
50% can be configurable to any percentage needed.
im using this extension to lower my minimal possible screen brightnes, but now it seems that when i dont set brighness to 0%, i have bright backlight even its dimmed.

Thanx.

VSync won't go past 60Hz on HRR monitors

For users with a non-60Hz monitor, when the brightness is not 100% (thus the extension is actively being used) the screen will act as though it is running at 60Hz, presumably from the VSync. This is unexpected and unintended behaviour, so I have opened up an issue for it.

HRR standing for High Refresh Rate.

Gnome-shell cpu spikes to 70%+

Greetings,

Let me preface this by mentioning that I love this plugin, it is the only thing that let's me use wayland without hurting my eyes. Thanks for all your effort.

I'm on Ubuntu 22.04 and for some reason when using this plugin, particularly when I'm watching something in my second monitor it spikes and all content starts stuttering.

I only have this extension installed, and when disabled this problem no longer appears.

Please let me know how can I debug this.

Uses 10-20% of CPU, even when brightness is set at 100%

The overlay seems to still exist even when the brightness slider is all the way up. Since this extension uses around 10-20% of my CPU I have to disable the extension completely. Fixing this should be as simple as turning off the overlay code when brightness is at 100%.

Installed but not working

I have installed soft-brightness in another computer - I have it already installed in another one, thanks for the app. However, this time it is not working. It seems correctly installed. I could install and run it from the gnome shell extension, but when I set it the on mode, nothing happens. I have tracked the logs, but it hasn't helped much.

gnome logs:
jan 21 19:51:48 marlon-Nitro-AN515-51 dbus-daemon[1557]: [session uid=1000 pid=1557] Activating service name='org.gnome.ChromeGnomeShell' requested by ':1.213' (uid=1000 pid=6501 comm="/usr/bin/python3 /usr/bin/chrome-gnome-shell chrom" label="unconfined")

soft-brightness logs:

jan 21 19:37:12 marlon-Nitro-AN515-51 gnome-shell-ext[4575]: JS LOG: Extension [email protected] already installed in /home/marlon/.local/share/gnome-shell/extensions/[email protected]. /home/marlon/.local/share/gnome-shell/extensions/[email protected] will not be loaded

Ubuntu 18.04 and GNOME Shell 3.28.4.

Thanks you so much!

Mouse Coursor invisible after login

sorry i accidentally closed this issue (#45). The problem persists:

  • I am using Extension Version 27, default settings
  • My System: $ uname -a
    Linux pc-021 5.11.0-40-generic #44~20.04.2-Ubuntu SMP Tue Oct 26 18:07:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

After the first login into Gnome, the Cursor are not visible. I have to change the Brightness in the Extension, then the Cursor shows up.

Build fails on GNOME 41.1

I am well aware that the extension does not currently support GNOME 41, but I did try to do a manual install and it seems the build process fails at the meson install command. Here's the output of the build:

ninja: Entering directory `build'
[0/1] Installing files.
Installing gschemas.compiled to /home/nilanjan/.local/share/gnome-shell/extensions/[email protected]/schemas
Installing /tmp/soft-brightness/schemas/org.gnome.shell.extensions.soft-brightness.gschema.xml to /home/nilanjan/.local/share/gnome-shell/extensions/[email protected]/schemas
Installing /tmp/soft-brightness/src/extension.js to /home/nilanjan/.local/share/gnome-shell/extensions/[email protected]
Installing /tmp/soft-brightness/src/prefs.js to /home/nilanjan/.local/share/gnome-shell/extensions/[email protected]
Installing /tmp/soft-brightness/src/utils.js to /home/nilanjan/.local/share/gnome-shell/extensions/[email protected]
Installing /tmp/soft-brightness/build/metadata.json to /home/nilanjan/.local/share/gnome-shell/extensions/[email protected]
Installing /tmp/soft-brightness/meson-gse/lib/convenience.js to /home/nilanjan/.local/share/gnome-shell/extensions/[email protected]
Installing /tmp/soft-brightness/meson-gse/lib/logger.js to /home/nilanjan/.local/share/gnome-shell/extensions/[email protected]
Installing /tmp/soft-brightness/dbus-interfaces/org.gnome.Mutter.DisplayConfig.xml to /home/nilanjan/.local/share/gnome-shell/extensions/[email protected]/dbus-interfaces
Running custom install script '/tmp/soft-brightness/meson-gse/meson-scripts/install-po soft-brightness /home/nilanjan/.local/share/gnome-shell/extensions/[email protected]/locale'
--- stdout ---
Unknown subcommand.

--- stderr ---

FAILED: install script '/tmp/soft-brightness/meson-gse/meson-scripts/install-po soft-brightness /home/nilanjan/.local/share/gnome-shell/extensions/[email protected]/locale' exit code 1, stopped
FAILED: meson-install 
/usr/bin/meson install --no-rebuild
ninja: build stopped: subcommand failed.

PS: appreciate the awesome work that you do and I love this extension. It is also only way I have to control my laptop's screen brightness, so please add 41 support as soon as possible.

docs - note how this affects battery life

Hi,

This extensions performs as described and softens the brightness. However, this is done via both 'backlight' and 'alpha' tuning. Since the major reason a person would dim their screen is to preserve battery, it would be helpful to add a note to clarify how this combination can be interpreted in terms of battery life.

For example, after installing this and enabling backlight control, I am able to set my brightness bar is at approx half. The screen is dimmer than before at very low brightness, but I am not sure if I am using more or less battery than I was before due to the alpha/backlight interaction.

mouse cursor click zone shifted

Hello,

There's a weird issue with Gnome 3.38 (tested on Fedora 33 / Gnome 20.10).

When the extension's option "Mouse cursor brightness control." is activated the mouse cursor zone which is used to know where you click is slightly shifted to 10~15px on the top-left.

Here a video showing the issue

Log that after having recorded the video, the issue really appears in the way that you will see, in the first part of the video when the option is activated, the mouse cursor duplicated - and where the real cursor is the one which is right-bottom shifted.

Deactivating the option fix this issue; and the extension works as expected, so it's not critical at all, but I still wanted to mention it. And maybe this issue is not specific to this extension, probably a more general issue somewhere in system library... I don't know.

Thanks.

[feature request] Enable display brightness via DCC

Hello!

I found out this interesting applet for adjusting the brightness.
This applet has option to use xrandr gamma brightnes, which is helpfull, but the actuall brightness of monitor does not change.

The ddcutil offers configuration of the monitor settings, that you would normally have to set via monitor keys. https://www.ddcutil.com/
The ddcui is GUI that also enables setting the monitor brightness via slider.

It would be great if this applet would be able to control actual monitor brightness (via ddcutil)
Ubuntu 18.04 does include ddcutil (cli) which can adjust brightness.

Here is blogpost how to use ddcutil: https://blog.tcharles.fr/ddc-ci-screen-control-on-linux/

(note: I have radeon graphics card with open source driver. I don't know how well it works on intel/nvidia)

Gnome 42 support

Thanks a lot for the great extension first of all!
I tried to port the extension manually to Gnome 42 (on Fedora 36) for testing but it seems to cause some wild flickering of the cursor
and the screen.
I don't have the knowledge to debug it but I'd be happy to provide debug logs etc

Tiny cursor

Hi there. Thanks a lot for this great extension.

Just am having a small issue as the clones cursor is tiny. Its size won't change even if I try to make it bigger in the settings.

My question was simply how to disable the mouse cloning altogether? I don't mind working with a bright cursor. I saw some references to disabling the cloning in the extension.js file but am unsure which way would be cleanest.

Thanks in advance.

Add shortcuts or other way to change the brightness programatically

Please add a way to control this brightness with keyboard and/or commands. I need a way to add this to my KDE connect so that I can adujst brightness with my phone while watching a movie. Right now, I am using xrandr for that, but it doesn't work with your extension, which is otherwise excellent.
Thank you

[feature request] Combine laptop backlight and alpha overlay brigheness in the same slider

It would be nice if there was an option to give, say, the upper 50% of the slider to setting the laptop's brightness, with the lower 50% controlling the alpha overlay.
This would be far better for controlling the brightness than having two brightness controls, one being the usual slider for the overlay, and the other being Fn+F? for the panel's brightness.
I tried implementing this myself, but I didn't have an idea as to where to start.

The way this would be implemented might be something like this (pseudocode):

if (brighness slider > 50%) {
   setDisplayBrightness(full_brightness);
   setOverlayBrightness(brightness slider / 2);
} else {
   setDisplayBrightness(brightness slider / 2);
   setOverlayBrightness(0);

Thanks in advance!

Cursor doesn't change depend on what it's being hovered

Hello,
First thanks for making this amazing extension, i'm very grateful,

but i found bug where the mouse cursor doesn't change depend on what it's being hovered, after i use it for quite some time, but it solve after i restart it, and happen again after being use for quite some time,

for example when i type this issues:
1d8f4d66-47f5-4509-8118-34c985f70d06

see, the cursor doesn't change when i hover it into text,

Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy

hope that you can fix it :), thanks

Mouse offset

I'm using arch with gnome 3.38.1 and I had to remove this extension since it was rendering the mouse with an offset.

from my journal

Oct 24 13:13:10 gnome-shell[684]: JS ERROR: TypeError: this._cursorSprite.set_anchor_point is not a function
                                        _updateMouseSprite@/home/andrea/.local/share/gnome-shell/extensions/[email protected]/extension.js:795:21

When I was clicking with the right or middle button of the mouse I could see two cursors.
The first was the one processed by the extension and showed a dimmed color while the second was brighter.
The bright one was correctly positioned and disappeared as soon as I moved the mouse.

No Schema Found

Hello and thank you for this great extension.

Could you please provide schema to it?

This way particular brightness settings could be easily bound to keyboard shortcuts with e.g:

gsettings set org.gnome.shell.extensions.soft-brightness current-brightness 0.6

All the Best.

Support Gnome 42

I'm requesting you to port this great extension to Gnome 42. Or let me know if there is any workaround I can do (as a user) to make this extension work on Gnome 42.

Doesn't install properly on Ubuntu 20.04 / Gnome 3.36.3

This extension was working great until I tried to install the most recent update from the Gnome Extensions Page this morning.
After I tried to install it, I got an error. Hoping this was an installation problem and not a problem with the extension (I love this extension as the built-in brightness control doesn't work), I tried to install it myself using the instructions on the Github page but I got the following error:

The settings of extension [email protected] had an error:

Error: Schema org.gnome.shell.extensions.soft-brightness could not be found for extension [email protected]. Please check your installation.

Stack trace:

getSettings@/home/nilanjan/.local/share/gnome-shell/extensions/[email protected]/convenience.js:88:15
setup@/home/nilanjan/.local/share/gnome-shell/extensions/[email protected]/prefs.js:43:31
buildPrefsWidget@/home/nilanjan/.local/share/gnome-shell/extensions/[email protected]/prefs.js:240:12
_init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:207:40
OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:13
run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:175:20
main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
run@resource:///org/gnome/gjs/modules/script/package.js:222:19
start@resource:///org/gnome/gjs/modules/script/package.js:206:5
@/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17

Clicking dysfunctional in applications

Whenever I lower the brightness with soft-brightness overlay, clicking in any application window won't work, no matter what the application. Gnome shell is still responsive on the other hand. Moreover mouse clicks are dysfunctional after suspend, no matter the brightness setting for the extension. It took me 2 days to realize that this extension is responsible, after uninstall all is fine again.

Fedora 31 Gnome 3.34.4

all changes get reverted too 100%

Hi,

On my HP x360 using your extension has some weird effect:

  • I change the gnome slide to approx 20%. The OLED brightness changes immediately to 20%. The brightness slowly goes up to 100%.
  • I use the keyboard brightness key to lower brightness. I have to press long / often to make an effect. While I am able to lower the brightness, it immediately goes up again to 100%.

On debug mode I get the following lines:
Dez 13 12:53:01 schlepptop gnome-shell[789]: Soft-Brightness: _storeBrightnessLevel(0.32) by proxy -> 33
Dez 13 12:53:01 schlepptop gnome-shell[789]: Soft-Brightness: _sliderChanged(slide, 0.32)
Dez 13 12:53:01 schlepptop gnome-shell[789]: Soft-Brightness: setSliderValue(0.32) [GS 3.33.90+]
Dez 13 12:53:01 schlepptop gnome-shell[789]: Soft-Brightness: _getBrightnessLevel() by proxy = 0.32 <- 32
Dez 13 12:53:01 schlepptop gnome-shell[789]: Soft-Brightness: _showOverlay(): set opacity 173.39999999999998 on overlay #0
Dez 13 12:53:01 schlepptop gnome-shell[789]: Soft-Brightness: _showOverlays(0.32, false)
Dez 13 12:53:01 schlepptop gnome-shell[789]: Soft-Brightness: _startCloningMouse()
Dez 13 12:53:01 schlepptop gnome-shell[789]: Soft-Brightness: _on_brightness_change: current-brightness=0.32, min-brightness=0.14999999999999997
Dez 13 12:53:01 schlepptop gnome-shell[789]: Soft-Brightness: _getBrightnessLevel() by proxy = 0.32 <- 32
Dez 13 12:53:01 schlepptop gnome-shell[789]: Soft-Brightness: _sync()
Dez 13 12:53:01 schlepptop pkexec[8332]: ente: Executing command [USER=root] [TTY=unknown] [CWD=/home/ente] [COMMAND=/usr/lib/gsd-backlight-helper /sys/devices/pci0000:00/0000:00:02.0

It looks like in the last step, you want to store a brightness of 0,32 but you actually store 0,33; this triggers a change on the input value and restarts the process. If I put the slider to 80% I see 21 times the full stack of log lines as above. The last set of log lines is:
Dez 13 13:04:40 schlepptop gnome-shell[789]: Soft-Brightness: setSliderValue(1) [GS 3.33.90+]
Dez 13 13:04:40 schlepptop gnome-shell[789]: Soft-Brightness: _getBrightnessLevel() by proxy = 1 <- 100
Dez 13 13:04:40 schlepptop gnome-shell[789]: Soft-Brightness: _stopCloningShowMouse(), restoring cursor visibility to true
Dez 13 13:04:40 schlepptop gnome-shell[789]: Soft-Brightness: _on_brightness_change: current-brightness=1, min-brightness=0.14999999999999997
Dez 13 13:04:40 schlepptop gnome-shell[789]: Soft-Brightness: _getBrightnessLevel() by proxy = 1 <- 100
Dez 13 13:04:40 schlepptop gnome-shell[789]: Soft-Brightness: _sync()
Dez 13 13:04:40 schlepptop pkexec[10946]: ente: Executing command [USER=root] [TTY=unknown] [CWD=/home/ente] [COMMAND=/usr/lib/gsd-backlight-helper /sys/devices/pci0000:00/0000:00:02.>

Separate slider for overlay opacity

Disabling "Use backlight control" option is great if one wants to be able to control backlight brightness and overlay opacity separately. Though it also changes the behavior of Gnome's brightness slider so that it controls overlay opacity instead of backlight brightness, which forces to use hotkeys to change the backlight brightness. I would like the slider behavior to remain unchanged, would it be possible to add a second slider that controls overlay opacity?

Screenshots are affected

When print-screening or using the gnome-screenshot app, the darkening is captured making the screenshot look dark as seen in the attached image.
Screenshot

Worth noting that window-capture produces unaffected screenshots.

Gnome 3.34 compatibility

When enabling this extension all applications become unresponsive to mouse events. Gnome Shell itself is working, that means I can log out or open new applications, but I cannot interact with any application using the mouse. Keyboard inputs still work. That's how I deactivate all extensions by issuing gsettings set org.gnome.shell disable-user-extensions true.

Output of journalctl -f:

Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: version 14 / git v14-1-g7214544
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: enable(), session mode = user
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _enable()
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _enableCloningMouse()
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _enableCloningMouse(): using Gnome Shell 3.32 method
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _swapMenu(): Replacing brightness menu item at index 1
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _enableMonitor2ing()
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _enableSettingsMonitoring()
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _enableScreenshotPatch()
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: Extension enabled
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _sync()
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _getBrightnessLevel() by proxy = 0.6 <- 60
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _on_brightness_change: current-brightness=0.6, min-brightness=0.05000000000000002
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _startCloningMouse()
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _showOverlays(0.6, false)
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _showOverlays(): enabledMonitors="built-in"
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _showOverlays(): skipping run as _monitorNames hasn't been set yet.
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _stopCloningShowMouse()
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _stopCloningMouse()
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _getBrightnessLevel() by proxy = 0.6 <- 60
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: setSliderValue(0.6) [GS 3.33.90+]
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _sliderChanged(slide, 0.6)
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _storeBrightnessLevel(0.6) by proxy -> 61
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: newDisplayConfig() callback
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _on_monitors_change()
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _on_monitors_change(): monitor="eDP-1", connector="eDP-1", index=0
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _getBrightnessLevel() by proxy = 0.61 <- 61
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _on_brightness_change: current-brightness=0.61, min-brightness=0.05000000000000002
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _startCloningMouse()
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _showOverlays(0.61, true)
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _showOverlays(): enabledMonitors="built-in"
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _showOverlays(): builtinMonitorName="eDP-1"
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _preventUnredirect(): disabling unredirects, prevent-unredirect=always
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: Create overlay #0: 2560x1440@0,0
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _showOverlay(): set opacity 99.45 on overlay #0
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _sync()
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _getBrightnessLevel() by proxy = 0.6 <- 60
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _on_brightness_change: current-brightness=0.6, min-brightness=0.05000000000000002
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _startCloningMouse()
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _showOverlays(0.6, false)
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _showOverlay(): set opacity 102 on overlay #0
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _getBrightnessLevel() by proxy = 0.6 <- 60
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Soft-Brightness: setSliderValue(0.6) [GS 3.33.90+]
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Window manager warning: Overwriting existing binding of keysym 31 with keysym 31 (keycode a).
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Window manager warning: Overwriting existing binding of keysym 32 with keysym 32 (keycode b).
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Window manager warning: Overwriting existing binding of keysym 33 with keysym 33 (keycode c).
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Window manager warning: Overwriting existing binding of keysym 37 with keysym 37 (keycode 10).
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Window manager warning: Overwriting existing binding of keysym 34 with keysym 34 (keycode d).
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Window manager warning: Overwriting existing binding of keysym 35 with keysym 35 (keycode e).
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Window manager warning: Overwriting existing binding of keysym 38 with keysym 38 (keycode 11).
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Window manager warning: Overwriting existing binding of keysym 39 with keysym 39 (keycode 12).
Sep 23 20:45:16 thinkpadx1 gnome-shell[1152]: Window manager warning: Overwriting existing binding of keysym 36 with keysym 36 (keycode f).
Sep 23 20:45:23 thinkpadx1 gnome-shell[1152]: Soft-Brightness: disable(), session mode = user
Sep 23 20:45:23 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _disable()
Sep 23 20:45:23 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _swapMenu(): Replacing brightness menu item at index 1
Sep 23 20:45:23 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _disableMonitor2ing()
Sep 23 20:45:23 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _disableSettingsMonitoring()
Sep 23 20:45:23 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _hideOverlays(): drop overlays, count=1
Sep 23 20:45:23 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _allowUnredirect(): enabling unredirects, prevent-unredirect=always
Sep 23 20:45:23 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _stopCloningShowMouse()
Sep 23 20:45:23 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _stopCloningMouse()
Sep 23 20:45:23 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _disableCloningMouse()
Sep 23 20:45:23 thinkpadx1 gnome-shell[1152]: Soft-Brightness: _disableScreenshotPatch()
Sep 23 20:45:23 thinkpadx1 gnome-shell[1152]: Soft-Brightness: Extension disabled
` ``

Cursor changes size on HDPI display

The cursor becomes size set by scale 100% when using an HDPI display even if the scale is set to a larger value, like 200%. This makes the cursor much smaller and undoes the setting of the scale. The workaround is to disable the "mouse brightness control setting".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.