linuxmint / linuxmint/cinnamon
Setting /sys/class/backlight value manually breaks Cinnamon Brightness OSD & Preference > Power Management
Nobody has claimed this yet.
- 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:
- Turn off the screen backlight completely
- 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)
- Create a "~/DisplayMin.sh" file with the following content:
echo 1 > /sys/class/backlight/intel_backlight/brightness - Set the script file chmod +x "~/DisplayMin.sh"
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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