linuxmint / linuxmint/cinnamon

Setting /sys/class/backlight value manually breaks Cinnamon Brightness OSD & Preference > Power Management

Open
#12,754 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

BUG
Dominant language
JavaScript
Stars
5.6k
Forks
915
Avg merge
5d 22h
Merged PRs (30d)
3

Description

Distribution

22.1

Package version

6.4.7

Graphics hardware in use

Intel HD Graphics 5500

Frequency

Always

Bug description

I set a shell script to a keyboard shortcut to:

  1. Turn off the screen backlight completely
  2. Set the brightness to the absolute minimum level

The script file has come with me to Ubuntu, popOS and Zorin.

The display off script runs:
echo 0 > /sys/class/backlight/intel_backlight/brightness

The min brightness script runs:
echo 1 > /sys/class/backlight/intel_backlight/brightness

After setting up the permissions, the script works fine and the brightness level changes accordingly. However having changed the brightness level the F11/F12 brightness up/down keys no longer work. The OSD is no longer triggered in Cinnamon and you cannot change the brightness via the keyboard.

Additionally the Preferences > Power Management applet takes a very long time to load and when it does, the Brightness tab is missing (showing only Power and Batteries).

To resolve the issue you must change the brightness via other means,reboot or you must restore the min brightness to a value of 18 or higher i.e.
echo 18 > /sys/class/backlight/intel_backlight/brightness

Once a value of between 18 and 937 is restored or higher is restored, the OSD resumes function, the F11/F12 brightness keys work once again, ,the Power Management applet does not lag and the Brightness tab is once more available in the Power Management applet.

Note: 937 is the maximum permissible value accepted by /sys/class/backlight/intel_backlight/brightness however 18 is not the minimum value, 0 is. consequently the OSD brightness control is not setting the brightness to the lowest possible active value (1) or backlight off (0).

There is a power management energy saving and visible brightness difference between level 1 and level 18. Therefore is appears that 18 is being set as an arbitrary minimum value at the expense of functionality.

Steps to reproduce
As Root

Open Terminal
sudo echo 1 > /sys/class/backlight/intel_backlight/brightness

Attempt to increase the brightness using hardware keys. The OSD will not appear and the brightness will not change.
Attempt to load Preferences > Power Management. It will lag on loading and the Brightness tab will be missing.

As a Standard User

Give the current user permissions to write to /sys/class/backlight/intel_backlight/brightness:

sudo nano /etc/udev/rules.d/90-backlight.rules

Enter:

SUBSYSTEM=="backlight", ACTION=="add",
RUN+="/bin/chgrp video /sys/class/backlight/intel_backlight/brightness",
RUN+="/bin/chmod o+w /sys/class/backlight/intel_backlight/brightness

Create a script to run as a shortcut (not necessary to reproduce)

  1. Create a "~/DisplayMin.sh" file with the following content:
    echo 1 > /sys/class/backlight/intel_backlight/brightness
  2. Set the script file chmod +x "~/DisplayMin.sh"
  3. Create a keyboard shortcut to execute the script file via Preference > Keyboard > Shortcuts > Add Custom Shortcut. The command is:
    gnome-terminal -e "~/DisplayMin.sh"

Reboot to apply the permissions change

Use the keyboard shortcut to set the display to minimum (value 1)

Attempt to increase the brightness using hardware keys. The OSD will not appear and the brightness will not change.
Attempt to load Preferences > Power Management. It will lag on loading and the Brightness tab will be missing.

Expected behavior

The brightness keys to work regardless of what the current value is set to in the brightness register. If Cinnamon believes that the brightness value is in error, it should reset it to the closets "legal" value rather than breaking.

The Power Management applet not to lag and the Brightness tab not to be missing.

Ideally the Brightness scale to at least go all the way to minimum brightness.

Ideally the brightness scale to allow brightness reduction all the way to 0 (e.g. turn the screen off while listening to music).

Additional information
  • Dell XPS 13 9343
  • 4K screen
  • Intel HD Graphics 5500
  • Firmware all current

The issue does not occur under Ubuntu 24.04, Pop OS 22.04 or Zorin OS 17.2 using the same procedure.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source files, tests, or entry points are named. First reproduce on Linux Mint 22.1 with Cinnamon 6.4.7 by setting intel_backlight/brightness to 1, then compare brightness-key, OSD, and Power Management behavior at values 0, 1, 18, and 937; done means keyboard controls, OSD, and the Brightness tab remain functional at the lowest supported value.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, shell
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.