On laptops, screen brightness and keyboard backlight isn't memorized between sessions

Bug #1270579 reported by Norbert on 2014-01-19
838
This bug affects 223 people
Affects Status Importance Assigned to Milestone
Dell Sputnik
Undecided
Unassigned
Linux Mint
Undecided
Unassigned
One Hundred Papercuts
Wishlist
Unassigned
upstart
Undecided
Unassigned
cinnamon-settings-daemon (Ubuntu)
Wishlist
Unassigned
gnome-settings-daemon (Ubuntu)
Wishlist
Unassigned
mate-settings-daemon (Ubuntu)
Wishlist
Martin Wimpress
upower (Ubuntu)
Wishlist
Unassigned
upstart (Ubuntu)
Wishlist
Unassigned

Bug Description

HOW TO REPRODUCE:
  1. Boot a laptop.
  2. Set a different screen (or keyboard) backlight brightness level.
  3. Reboot.

RESULT:
  Backlight is not memorized.

FIX:
  A. For Ubuntu 12.04 LTS and 14.04 LTS install my package from PPA
    sudo add-apt-repository ppa:nrbrtx/sysvinit-backlight
    sudo apt-get update
    sudo apt-get install sysvinit-backlight

    NOTES:
    1. If you have installed previous non-deb version, please remove it carefully manually
      sudo rm /etc/rc?.d/?25backlight /etc/init.d/brightness /etc/rc?.d/?25brightness
   2. If you have installed previous version from my PPA on Ubuntu 14.04 LTS, please reinstall the package by:
     sudo apt-get purge sysvinit-backlight
      sudo apt-get install sysvinit-backlight
    3. Version 0.1ubuntu1 supports save/restore of keyboard backlight too.

  B. Ubuntu 14.10 is at EOL (from July 2015), Ubuntu 15.04 is at EOL (from January 2016), Ubuntu 15.10 is near EOL (really at July 2016), so users should upgrade them to Ubuntu 16.04 (see C below).
     My script is incompatible with these Ubuntu versions - remove it with
      sudo apt-get purge sysvinit-backlight
      sudo add-apt-repository -r ppa:nrbrtx/sysvinit-backlight

  C. Ubuntu 15.04, 15.10 and 16.04 LTS have systemd-backlight@.service. It saves and restores screen and keyboard backlight levels.
     My script is incompatible with these Ubuntu versions.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: initscripts 2.88dsf-41ubuntu5
ProcVersionSignature: Ubuntu 3.13.0-4.19-generic 3.13.0-rc8
Uname: Linux 3.13.0-4-generic i686
ApportVersion: 2.13.1-0ubuntu1
Architecture: i386
CurrentDesktop: GNOME
Date: Sun Jan 19 17:20:26 2014
InstallationDate: Installed on 2013-10-20 (91 days ago)
InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Release i386 (20131016.1)
SourcePackage: sysvinit
UpgradeStatus: Upgraded to trusty on 2013-11-19 (61 days ago)

Norbert (nrbrtx) wrote :
description: updated
description: updated
Norbert (nrbrtx) on 2014-01-19
description: updated
description: updated
description: updated
Norbert (nrbrtx) on 2014-02-09
tags: added: trusty-desktop
Norbert (nrbrtx) on 2014-02-16
tags: added: quantal raring
Norbert (nrbrtx) wrote :

Ubuntu 14.04 is still affected by this bug. Please fix it.

Changed in sysvinit (Ubuntu):
status: New → Confirmed
Changed in hundredpapercuts:
status: New → Confirmed
importance: Undecided → Medium
Changed in sysvinit (Ubuntu):
importance: Undecided → Medium
Norbert (nrbrtx) wrote :

Thank you, Alberto!

Changed in sysvinit (Debian):
status: Unknown → New
maxspice (brksays) wrote :

This bug is a PITA for laptop Ubuntu users like me. Hopefully developers will look into this small but nagging issue.

Norbert (nrbrtx) wrote :

Bug exists in Ubuntu 14.10 (installed from Ubuntu 14.10 _Utopic Unicorn_ - Alpha i386 (20140902)).

tags: added: utopic
Norbert (nrbrtx) wrote :

Bug exists in Ubuntu 14.10 MATE beta.

Changed in ubuntu-mate:
status: New → Opinion
Changed in ubuntu-mate:
importance: Undecided → Wishlist
Norbert (nrbrtx) wrote :

This bug is a great usability problem. Let's see:
1. User boots laptop (cold boot, not wake from suspend)
2. User sets comfortable backlight level
3. User ends his/her work by shutting down the laptop (not suspend, so backlight level is not saved)
4. Go to 1 (another cold boot with reseted backlight level).

According to original Ask Ubuntu thread there are many users which are interested in implementation of the aforementioned functionality.

Other distros have this functionality, but Ubuntu does not. It is a disadvantage.
On my laptop I (as an author of the script) have backlight save/restore functionality, but newbies does not. I think that this bug must be fixed as fast as possible.

Norbert (nrbrtx) wrote :

Reinstalled Utopic from official beta2 , the bug is still here.

Norbert (nrbrtx) wrote :

It seems that Ubuntu Utopic has systemd service file for backlight save and restore -
   dpkg -S systemd-backlight
      systemd: /usr/share/man/man8/systemd-backlight@.service.8.gz
      systemd: /lib/systemd/systemd-backlight
      systemd: /usr/share/man/man8/systemd-backlight.8.gz
      systemd: /lib/systemd/system/systemd-backlight@.service

but it does not work yet.

Martin Pitt (pitti) wrote :

Right, if you boot 14.10 with systemd this should already work. But that job doesn't run under upstart. So either we wait until systemd becomes the init in Ubuntu, or we write a corresponding upstart job that calls /lib/systemd/systemd-backlight.

Changed in sysvinit (Ubuntu):
importance: Medium → Wishlist
status: Confirmed → Triaged
status: Triaged → Invalid
Changed in systemd (Ubuntu):
importance: Undecided → Wishlist
status: New → Triaged
summary: - Ubuntu should have an init script for saving/restoring backlight level
+ Ubuntu should have an upstart job for saving/restoring backlight level
on laptops

Dear Martin! Thank you for reply.

How I can help to implement this functionality to Ubuntu 12.04 LTS and 14.04 LTS ?
I'm ready to help. In which place I should ask sponsorship and help (IRC or something)?

I think that such script is very useful. See my comment 8 for explanation.

Norbert (nrbrtx) wrote :

Bug exists in Ubuntu Utopic 14.10 final.

@pitti
Is it possible to include my init scripts to non-systemd versions of Ubuntu?

SNIKERSMRG (snikersmrg) wrote :

Russian version Ubuntu 14.04 in notebook Samsung NP350V5C (Intel Graphics + AMD Graphics) problem exists.

http://forum.ubuntu.ru/index.php?topic=255145.15

Norbert (nrbrtx) wrote :

Ready for use archive is in attachment, you can extract it with the following command:
sudo tar -zxvf upstart_backlight.tar.gz -C /

Cody Garver (codygarver) wrote :

Norbert, I followed your instructions and it's not working on my laptop. It's nvidia optimus with only the intel gpu active.

Norbert (nrbrtx) wrote :

Cody, the current version of my script works only with one graphical adapter (its brightness file is named /sys/class/backlight/acpi_video0/brightness).
You can customize this value in my script at row 16
     BRIGHTNESS_CONTROL=/sys/class/backlight/acpi_video0/brightness
to path which is *correct* for your hardware.

Correct path may be determined by the following steps:
1. List all paths with brightness file in /sys/class/backlight dir with the command
     ls /sys/class/backlight/*/brightness

example:
     /sys/class/backlight/acpi_video0/brightness
     /sys/class/backlight/acpi_video1/brightness

2a. Read values of brightness from files with the command:
     cat /sys/class/backlight/*/brightness

example:
     3
     8

2b. Change backlight level with hardware keys (Fn+...) and read again:
     cat /sys/class/backlight/*/brightness

example:
     4
     8
2c. The *correct* path to brightness control file corresponds to the changed value.

example:
     /sys/class/backlight/acpi_video0/brightness # first value changed, so first file
3. Try to write brightness level manually to *correct* brightness file:
     sudo su
     echo 3 > /sys/class/backlight/acpi_video0/brightness # example on my hardware
4. Change BRIGHTNESS_CONTROL variable to the *correct* path in /etc/init.d/brightness with the command
     sudo gedit /etc/init.d/brightness

I'll update my script soon to do all steps automatically.

Norbert (nrbrtx) on 2014-12-28
Changed in sysvinit (Ubuntu):
status: Invalid → Confirmed
Norbert (nrbrtx) wrote :

Dear all!

According to the list of duplicates and bug heat this bug/feature request is very important.

As you know laptop market share is gigantic (see for example http://www.statista.com/statistics/276772/ultrabook-share-of-global-notebook-market-since-2011/ for stats).
Also Ubuntu and Debian market share are increasing.

So I can't believe why this usability fault exists in Ubuntu (and Debian) for years.
It seems that guys from `systemd` understand the problem correctly (sooner or later - on 14 Aug 2013, see https://github.com/systemd/systemd/commits/56f64d95763a799ba4475daf44d8e9f72a1bd474/src/backlight/backlight.c ), but `upstart` and `sysvinit` developers not.

As you can remember I tried to fix the problem by myself - I created first version of an init script for saving and restoring backlight level (on 10 Dec 2012 - two years ago).
It had one disadvantage - it operates only when laptop has one graphical adaptor and its name was hardcoded to the script (*acpi_video0* in my case).
So today I present new version of a script - it can save and restore backlight levels of all graphical, adaptors, which are found in `/sys/class/backlight/*`.
The init script with symlink are packed to archive (see attachment).
If you have installed its previous version (see comment #15) - you can remove its files with commands:
     sudo rm /etc/rc?.d/?25backlight /etc/init.d/brightness
then extract new version with commands:
     sudo tar -zxvf upstart_brightness.tar.gz -C /

I hope my script will help somebody.
Thanks for testing!

Avi Romanoff (aroman) on 2014-12-29
Changed in elementaryos:
status: New → Confirmed
Andreas Mohr (andi) wrote :

Commenting on #18:
Checking the brightness script (POSIX-incompatible bashisms etc.), my system says:

# checkbashisms brightness
possible bashism in brightness line 30 (unsafe echo with backslash):
                                echo "\tloading $saved_controller_name"
possible bashism in brightness line 40 (unsafe echo with backslash):
                                echo "\tsaving $controller_name"
possible bashism in brightness line 50 (unsafe echo with backslash):
                                echo "\tCurrent brightness level for $controller_name is $(cat $controller/brightness)"
possible bashism in brightness line 58 (unsafe echo with backslash):
                                        echo "\tSaved brightness level for $saved_controller_name is $(cat $saved_file)"

(should probably prefer using the printf helper for that, since a \t control code might possibly require echo -e, yet availability of sufficiently compatible echo -e possibly isn't guaranteed)

Also some variable uses are not "-quoted, which will cause issues in case of space-containing filesystem items (which is somewhat unlikely to be encountered in the case of firmly Linux-managed /proc or /sys entries, but still...).

And some path strings are openly duplicated rather than assigned to helper variables.

All in all these are fairly minor issues, and I didn't runtime test the script anyway. I simply decided to be bored enough to do a code review ;)

Norbert (nrbrtx) wrote :

Thank you, Andreas!

 It is free software. I'm ready to receive your patch ;)

I'm not bash/sh guru.
I was focused on functionality, not coding style. Did the script work as expected?

Norbert (nrbrtx) wrote :

Bug exists in Linux Mint 17 and 17.1.

erik (jacoberikjohn) wrote :

Hi Norbert,

Your solution works for Ubuntu 14.04 LTS, Sony Vaio Series T laptop, Intel graphics 4000.

Thanks man!

Regards,
Erik

Norbert (nrbrtx) on 2015-01-09
description: updated
Norbert (nrbrtx) on 2015-01-09
description: updated
Norbert (nrbrtx) wrote :

Dear all!

Are you found my script useful?

If YES, you can write your comments and suggestions here or in the mail lists:
* Ubuntu Upstart devel - https://lists.ubuntu.com/archives/upstart-devel/2015-January/thread.html
* Ubuntu Devel Discuss - https://lists.ubuntu.com/archives/ubuntu-devel-discuss/2015-January/015280.html
* Ubuntu Laptop Devel - https://lists.ubuntu.com/archives/laptop-devel/2015-January/thread.html
* Debian Laptop - https://lists.debian.org/debian-laptop/2014/12/msg00039.html
* Debian Pkg SysVInit Devel - http://lists.alioth.debian.org/pipermail/pkg-sysvinit-devel/2014-December/007949.html

If NO - I'll continue to use my script locally, while you can use it by manual installation from archive (see comment 18 above).

elementary OS is interested in your script, I'll give you more feedback
when I next test your script

On Tue, Jan 13, 2015 at 1:01 PM, Norbert <email address hidden> wrote:

> Dear all!
>
> Are you found my script useful?
>
> If YES, you can write your comments and suggestions here or in the mail
> lists:
> * Ubuntu Upstart devel -
> https://lists.ubuntu.com/archives/upstart-devel/2015-January/thread.html
> * Ubuntu Devel Discuss -
> https://lists.ubuntu.com/archives/ubuntu-devel-discuss/2015-January/015280.html
> * Ubuntu Laptop Devel -
> https://lists.ubuntu.com/archives/laptop-devel/2015-January/thread.html
> * Debian Laptop -
> https://lists.debian.org/debian-laptop/2014/12/msg00039.html
> * Debian Pkg SysVInit Devel -
> http://lists.alioth.debian.org/pipermail/pkg-sysvinit-devel/2014-December/007949.html
>
> If NO - I'll continue to use my script locally, while you can use it by
> manual installation from archive (see comment 18 above).
>
> --
> You received this bug notification because you are subscribed to
> elementary.
> https://bugs.launchpad.net/bugs/1270579
>
> Title:
> Ubuntu should have an upstart job for saving/restoring backlight level
> on laptops
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/elementaryos/+bug/1270579/+subscriptions
>

--
Cody Garver

tags: added: i386
removed: precise quantal raring saucy trusty-desktop utopic
Norbert (nrbrtx) on 2015-01-17
tags: added: precise quantal raring saucy utopic
removed: i386

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in upstart (Ubuntu):
status: New → Confirmed
Changed in upstart (Ubuntu):
importance: Undecided → Wishlist
description: updated
summary: - Ubuntu should have an upstart job for saving/restoring backlight level
- on laptops
+ On laptops, screen brightness isn't memorized between sessions
Changed in hundredpapercuts:
importance: Medium → Low
Changed in systemd (Ubuntu):
importance: Wishlist → Low
Changed in sysvinit (Ubuntu):
importance: Wishlist → Low
Changed in upstart (Ubuntu):
importance: Wishlist → Low
description: updated
Changed in upstart (Ubuntu):
importance: Low → Wishlist
Changed in sysvinit (Ubuntu):
importance: Low → Wishlist
Changed in systemd (Ubuntu):
importance: Low → Wishlist
Changed in hundredpapercuts:
importance: Low → Wishlist
no longer affects: systemd (Ubuntu)
no longer affects: sysvinit (Ubuntu)
affects: sysvinit (Debian) → sysvinit (Ubuntu)
no longer affects: sysvinit (Ubuntu)
Changed in upstart:
status: New → Confirmed
no longer affects: hundredpapercuts
affects: ubuntu-mate → hundredpapercuts
Changed in hundredpapercuts:
status: Opinion → Confirmed
Changed in linuxmint:
status: New → Confirmed

This bug only affects stable releases but, because the lost of functionality it introduces isn't of high importance, it isn't a valid candidate for a stable release update.

That means the script will never be officially published in Ubuntu, and the bug will just go away when systemd becomes the new init system.

Changed in upstart (Ubuntu):
status: Confirmed → Won't Fix
Changed in hundredpapercuts:
status: Confirmed → Won't Fix
Jorge Juan (jjchico) wrote :

I wrote a couple of upstart scripts to save and retore brightness between bootups. I hope the scripts are smart enough to run unmodified in any system with /sys/class/backlight.

You can find them at bitbucket with install instructions:

https://bitbucket.org/jjchico/upstart-brightness

Quick manual:

cd /etc/init
sudo wget https://bitbucket.org/jjchico/upstart-brightness/raw/d9a5d9484475eb1256d56c64b28e680a7aeae72c/brightness-store.conf
sudo wget https://bitbucket.org/jjchico/upstart-brightness/raw/d9a5d9484475eb1256d56c64b28e680a7aeae72c/brightness-restore.conf

Test reports and patches are wellcome (these are my first upstart scripts).

Enjoy!

Norbert (nrbrtx) wrote :

Bug exists in Ubuntu 15.04 alpha2.

tags: added: vivid
Cody Garver (codygarver) wrote :

Tracked by elementary OS @ bug #1080552

Changed in elementaryos:
status: Confirmed → Invalid
no longer affects: elementaryos
Norbert (nrbrtx) on 2015-03-28
description: updated
description: updated
Norbert (nrbrtx) on 2015-03-29
description: updated
Norbert (nrbrtx) wrote :

Dear all!

As you can read from bug description, I created Ubuntu package for saving and restoring backlight (brightness) level on laptops.

This package installs one file - "/etc/init.d/sysvinit-backlight" (sysvinit script).
You can install my package from PPA with the commands below:
    sudo add-apt-repository ppa:nrbrtx/sysvinit-backlight
    sudo apt-get update
    sudo apt-get install sysvinit-backlight

You can remove it by
    sudo apt-get purge sysvinit-backlight

Please note: if you have installed the previous version of my script, please remove it by
    sudo rm /etc/rc?.d/?25backlight /etc/init.d/brightness /etc/rc?.d/?25brightness

The script functionality is:
   * save backlight (brightness) levels of all video adapters on reboot and shutdown (runlevel 0 and 6)
   * load backlight (brightness) levels for all video adapters on boot (runlevel S and 2)
   * this version supports hybrid graphics

The script options are:
   * sudo service sysvinit-backlight status (show current brightness levels and saved in files values)
   * sudo service sysvinit-backlight start (set saved level from files)
   * sudo service sysvinit-backlight stop (save current level to files)

Known problems:
   * brightness resets to maximum on login to MATE session (may be related to https://github.com/mate-desktop/mate-power-manager/issues/76)

Changes:
    I removed all bashisms and made code more clear - thanks to Andreas Mohr (andi).

I tested my package on Ubuntu 12.04.5 LTS, 14.04.2 LTS and Ubuntu 14.10.

Norbert (nrbrtx) on 2015-03-29
tags: removed: vivid
Doctor Rover (doctor-rover) wrote :

Unfortunately, the fix doesn't work for me. After reboot, the screen brightness is always on the minimum level.
Maybe I did something wrong... Is there a need to do something after the installation of the package with the script or installation itself is supposed to be enough?
Ubuntu 14.10 64bit
Notebook: Asus N550JK
Graphics: Integrated Intel HD Graphics 4600 + NVIDIA GTX850M

The only solution is the mine
https://bugs.launchpad.net/ubuntu/+source/gnome-power-manager/+bug/923940 and i am annoyed about this stupid solutions

Il 04/apr/2015 18:00, Doctor Rover <email address hidden> ha scritto: > > Unfortunately, the fix doesn't work for me. After reboot, the screen brightness is always on the minimum level. > Maybe I did something wrong... Is there a need to do something after the installation of the package with the script or installation itself is supposed to be enough? > Ubuntu 14.10 64bit > Notebook: Asus N550JK > Graphics: Integrated Intel HD Graphics 4600 + NVIDIA GTX850M > > -- > You received this bug notification because you are subscribed to a > duplicate bug report (923940). > https://bugs.launchpad.net/bugs/1270579 > > Title: >   On laptops, screen brightness isn't memorized between sessions > > Status in Dell Sputnik: >   New > Status in One Hundred Papercuts: >   Won't Fix > Status in The Linux Mint Distribution: >   Confirmed > Status in Upstart: >   Confirmed > Status in upstart package in Ubuntu: >   Won't Fix > > Bug description: >   HOW TO REPRODUCE: >   1. Boot a laptop. >   2. Set a different screen brightness level. >   3. Reboot. > >   RESULT: >   Backlight is not memorized. > >   FIX: >     Install package from PPA >       sudo add-apt-repository ppa:nrbrtx/sysvinit-backlight >       sudo apt-get update >       sudo apt-get install sysvinit-backlight > >   NOTE: >     If you have installed previous version, please remove it carefully manually >       sudo rm /etc/rc?.d/?25backlight /etc/init.d/brightness /etc/rc?.d/?25brightness > >   ProblemType: Bug >   DistroRelease: Ubuntu 14.04 >   Package: initscripts 2.88dsf-41ubuntu5 >   ProcVersionSignature: Ubuntu 3.13.0-4.19-generic 3.13.0-rc8 >   Uname: Linux 3.13.0-4-generic i686 >   ApportVersion: 2.13.1-0ubuntu1 >   Architecture: i386 >   CurrentDesktop: GNOME >   Date: Sun Jan 19 17:20:26 2014 >   InstallationDate: Installed on 2013-10-20 (91 days ago) >   InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Release i386 (20131016.1) >   SourcePackage: sysvinit >   UpgradeStatus: Upgraded to trusty on 2013-11-19 (61 days ago) > > To manage notifications about this bug go to: > https://bugs.launchpad.net/dell-sputnik/+bug/1270579/+subscriptions

Norbert (nrbrtx) on 2015-04-12
summary: - On laptops, screen brightness isn't memorized between sessions
+ On laptops, screen brightness and keyboard backlight isn't memorized
+ between sessions
Norbert (nrbrtx) on 2015-04-13
description: updated
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in cinnamon-settings-daemon (Ubuntu):
status: New → Confirmed
Changed in gnome-settings-daemon (Ubuntu):
status: New → Confirmed
Changed in mate-settings-daemon (Ubuntu):
status: New → Confirmed
Changed in upower (Ubuntu):
status: New → Confirmed
Changed in cinnamon-settings-daemon (Ubuntu):
importance: Undecided → Wishlist
Changed in gnome-settings-daemon (Ubuntu):
importance: Undecided → Wishlist
Changed in mate-settings-daemon (Ubuntu):
importance: Undecided → Wishlist
Changed in upower (Ubuntu):
importance: Undecided → Wishlist
Norbert (nrbrtx) on 2015-04-25
description: updated
description: updated
Norbert (nrbrtx) on 2015-04-25
description: updated
Michel-Ekimia (michel.ekimia) wrote :

@Norbert : can you explain what is keeping you sysvinit-backlight from working on 14.04.2 ?

Norbert (nrbrtx) wrote :

@Ekimia
If you use utopic kernel and xserver (https://wiki.ubuntu.com/Kernel/LTSEnablementStack#Desktop) on 14.04.2 - it is a known issue. Please install that packages from trusty. If you use MATE - it may reset backlight levels on login because of bug in mate-power-manager.
I collect all known issues on my PPA page (https://launchpad.net/~nrbrtx/+archive/ubuntu/sysvinit-backlight).

Changed in mate-settings-daemon (Ubuntu):
assignee: nobody → Martin Wimpress (flexiondotorg)
M. George (froggz19-0) wrote :

Not fixed in 15.04. G75VW keyboard backlight and screen brightness settings are not saved. Also, the screen flashes like hell when trying to change the brightness using the 'Fn' keys.

chenzero (chenzero) wrote :

I encountered the same problem in 14.04.1 x64
BTW, I found that another system setting -- Mouse & Touchpad also not saved after reboot.
reproduce steps:
1. Open System Settings >> Mouse & Touchpad.
2. OFF Touchpad
3. reboot, and Touchpad is active, I wish it's disabled.

Thanks!

chenzero (chenzero) wrote :

some workaround:
to disable touchpad, add a line in .bashrc
gsettings set org.gnome.settings-daemon.peripherals.touchpad touchpad-enabled false

another way to adjust brightness:
1. cd /sys/class/backlight/$COM_backlight/
2. check the value in the file: max_brightness
3. sudo open the file:brightness and set it to [0, max-brightness), NOTE: MUST < max-brightness.

for convinence, create a shell script, and sudo it.

#!/bin/bash
# NOTE: the prefer value MUST < max-brightness.
echo "you prefer value" > /sys/class/backlight/$COM_backlight/brightness

reference:
http://askubuntu.com/questions/540911/how-to-adjust-screen-brightness-in-ubuntu-14-04

Download full text (3.4 KiB)

Are you trying to googling "mouse set file conf" or something about configuration file that runs on boot (aka init.rc). Perhaps this is the only way to make modification persistant.

Il 19/ott/2015 16:46, chenzero <email address hidden> ha scritto:
>
> I encountered the same problem in 14.04.1 x64
> BTW, I found that another system setting -- Mouse & Touchpad also not saved after reboot.
> reproduce steps:
> 1. Open System Settings >> Mouse & Touchpad.
> 2. OFF Touchpad
> 3. reboot, and Touchpad is active, I wish it's disabled.
>
> Thanks!
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (923940).
> https://bugs.launchpad.net/bugs/1270579
>
> Title:
>   On laptops, screen brightness and keyboard backlight isn't memorized
>   between sessions
>
> Status in Dell Sputnik:
>   New
> Status in One Hundred Papercuts:
>   Won't Fix
> Status in Linux Mint:
>   Confirmed
> Status in upstart :
>   Confirmed
> Status in cinnamon-settings-daemon package in Ubuntu:
>   Confirmed
> Status in gnome-settings-daemon package in Ubuntu:
>   Confirmed
> Status in mate-settings-daemon package in Ubuntu:
>   Confirmed
> Status in upower package in Ubuntu:
>   Confirmed
> Status in upstart package in Ubuntu:
>   Won't Fix
>
> Bug description:
>   HOW TO REPRODUCE:
>     1. Boot a laptop.
>     2. Set a different screen (or keyboard) backlight brightness level.
>     3. Reboot.
>
>   RESULT:
>     Backlight is not memorized.
>
>   FIX:
>     A. For Ubuntu 12.04 LTS and 14.04 LTS install my package from PPA
>       sudo add-apt-repository ppa:nrbrtx/sysvinit-backlight
>       sudo apt-get update
>       sudo apt-get install sysvinit-backlight
>
>       NOTES:
>       1. If you have installed previous non-deb version, please remove it carefully manually
>         sudo rm /etc/rc?.d/?25backlight /etc/init.d/brightness /etc/rc?.d/?25brightness
>       2. If you have installed previous version from my PPA on Ubuntu 14.04, please reinstall the package by:
>         sudo apt-get purge sysvinit-backlight
>         sudo apt-get install sysvinit-backlight
>       3. Version 0.1ubuntu1 supports save/restore of keyboard backlight too.
>
>     B. Ubuntu 14.10 is near EOL (really in July 2015), so users should upgrade it to Ubuntu 15.04 (see C below).
>        My script seems to be incompatible with this Ubuntu version - remove it with
>         sudo apt-get purge sysvinit-backlight
>         sudo add-apt-repository -r ppa:nrbrtx/sysvinit-backlight
>
>     C. Ubuntu 15.04 has systemd-backlight@.service. It saves and restores screen and keyboard backlight levels.
>        My script is incompatible with this Ubuntu version.
>
>   ProblemType: Bug
>   DistroRelease: Ubuntu 14.04
>   Package: initscripts 2.88dsf-41ubuntu5
>   ProcVersionSignature: Ubuntu 3.13.0-4.19-generic 3.13.0-rc8
>   Uname: Linux 3.13.0-4-generic i686
>   ApportVersion: 2.13.1-0ubuntu1
>   Architecture: i386
>   CurrentDesktop: GNOME
>   Date: Sun Jan 19 17:20:26 2014
>   InstallationDate: Installed on 2013-10-20 (91 days ago)
>   InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Release ...

Read more...

SiRiusCb (xlat) wrote :
Download full text (3.6 KiB)

I have said that months ago. Poor

Il 19/ott/2015 18:00, chenzero <email address hidden> ha scritto:
>
> some workaround:
> to disable touchpad, add a line in .bashrc
> gsettings set org.gnome.settings-daemon.peripherals.touchpad touchpad-enabled false
>
> another way to adjust brightness:
> 1. cd /sys/class/backlight/$COM_backlight/
> 2. check  the value in the file: max_brightness
> 3. sudo open the file:brightness and set it to [0, max-brightness), NOTE: MUST < max-brightness.
>
> for convinence, create a shell script, and sudo it.
>
> #!/bin/bash
> # NOTE: the prefer value MUST < max-brightness.
> echo "you prefer value" > /sys/class/backlight/$COM_backlight/brightness
>
> reference:
> http://askubuntu.com/questions/540911/how-to-adjust-screen-brightness-in-ubuntu-14-04
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (923940).
> https://bugs.launchpad.net/bugs/1270579
>
> Title:
>   On laptops, screen brightness and keyboard backlight isn't memorized
>   between sessions
>
> Status in Dell Sputnik:
>   New
> Status in One Hundred Papercuts:
>   Won't Fix
> Status in Linux Mint:
>   Confirmed
> Status in upstart :
>   Confirmed
> Status in cinnamon-settings-daemon package in Ubuntu:
>   Confirmed
> Status in gnome-settings-daemon package in Ubuntu:
>   Confirmed
> Status in mate-settings-daemon package in Ubuntu:
>   Confirmed
> Status in upower package in Ubuntu:
>   Confirmed
> Status in upstart package in Ubuntu:
>   Won't Fix
>
> Bug description:
>   HOW TO REPRODUCE:
>     1. Boot a laptop.
>     2. Set a different screen (or keyboard) backlight brightness level.
>     3. Reboot.
>
>   RESULT:
>     Backlight is not memorized.
>
>   FIX:
>     A. For Ubuntu 12.04 LTS and 14.04 LTS install my package from PPA
>       sudo add-apt-repository ppa:nrbrtx/sysvinit-backlight
>       sudo apt-get update
>       sudo apt-get install sysvinit-backlight
>
>       NOTES:
>       1. If you have installed previous non-deb version, please remove it carefully manually
>         sudo rm /etc/rc?.d/?25backlight /etc/init.d/brightness /etc/rc?.d/?25brightness
>       2. If you have installed previous version from my PPA on Ubuntu 14.04, please reinstall the package by:
>         sudo apt-get purge sysvinit-backlight
>         sudo apt-get install sysvinit-backlight
>       3. Version 0.1ubuntu1 supports save/restore of keyboard backlight too.
>
>     B. Ubuntu 14.10 is near EOL (really in July 2015), so users should upgrade it to Ubuntu 15.04 (see C below).
>        My script seems to be incompatible with this Ubuntu version - remove it with
>         sudo apt-get purge sysvinit-backlight
>         sudo add-apt-repository -r ppa:nrbrtx/sysvinit-backlight
>
>     C. Ubuntu 15.04 has systemd-backlight@.service. It saves and restores screen and keyboard backlight levels.
>        My script is incompatible with this Ubuntu version.
>
>   ProblemType: Bug
>   DistroRelease: Ubuntu 14.04
>   Package: initscripts 2.88dsf-41ubuntu5
>   ProcVersionSignature: Ubuntu 3.13.0-4.19-generic 3.13.0-rc8
>   Uname: Linux 3.13.0-4-generic i686
>  ...

Read more...

chenzero (chenzero) wrote :

I did not notice that was mentioned. :)
Thanks for remind!

Norbert (nrbrtx) on 2015-10-24
description: updated
description: updated
r2rien (r2rien) wrote :

@Norbert, thanks for your solution
(for users still on trusty/not on systemd) please find enclosed a patch to run it on suspend/hibernate/resume/thaw with pm-utils
+ ln -s /etc/init.d/sysvinit-backlight /etc/pm/sleep.d/20_sysvinit-backlight

The attachment "sysvinit-backlight.pm-utils.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Changed in mate-settings-daemon (Ubuntu):
status: Confirmed → Fix Released
Tim (darkxst) on 2016-03-29
Changed in gnome-settings-daemon (Ubuntu):
status: Confirmed → Won't Fix
Norbert (nrbrtx) on 2016-05-26
description: updated
aljosa (aljosa-p) wrote :

ASUS G752VS non-optimus laptop (Nvidia GTX1070)
Ubuntu 17.04
Linux 4.10.0-15-generic
Xorg-Server-1.19.3

Ubuntu 17.04 doesn't save my brightness settings. I can adjust the screen brightness but after restarting the screen brightness of my laptop resets to maximum. How can I ensure that my brightness preference will persist after reboot?

Kai-Heng Feng (kaihengfeng) wrote :

@aljosa,

Now the brightness save/restore is handled by systemd service now. Can you check the status of the service?

On my system, I can find it via
Save Screen Backlight Brightness of backlight:intel_backlight

$ systemctl | grep backlight.service | awk '{print $1}'
systemd-backlight@backlight:intel_backlight.service
systemd-backlight@leds:dell::kbd_backlight.service

$ systemctl status systemd-backlight@backlight:intel_backlight.service

It should be 'Active: active (exited)'

aljosa (aljosa-p) wrote :

Hello,
inside "/sys/class/backlight/" I have two folders: "acpi_video0" and "acpi_video1":

~$ systemctl status systemd-backlight@backlight:acpi_video0.service
● systemd-backlight@backlight:acpi_video0.service - Load/Save Screen Backlight B
   Loaded: loaded (/lib/systemd/system/systemd-backlight@.service; static; vendo
   Active: active (exited) since Sat 2017-04-08 13:37:31 CEST; 16min ago
     Docs: man:systemd-backlight@.service(8)
 Main PID: 683 (code=exited, status=0/SUCCESS)

~$ systemctl status systemd-backlight@backlight:acpi_video1.service
● systemd-backlight@backlight:acpi_video1.service - Load/Save Screen Backlight B
   Loaded: loaded (/lib/systemd/system/systemd-backlight@.service; static; vendo
   Active: active (exited) since Sat 2017-04-08 13:37:31 CEST; 22min ago
     Docs: man:systemd-backlight@.service(8)
 Main PID: 684 (code=exited, status=0/SUCCESS)

Today I received many Ubuntu updates (kernel included), and I also installed freshly released Nvidia 381.09 driver (via “Graphics Drivers” team - Proprietary GPU Drivers PPA).
Now brightness settings are correctly saved, but I have a new problem: changing brightness level doesn't produce any effect (both with or without Nvidia driver installed).

Kai-Heng Feng (kaihengfeng) wrote :

I guess brightness in 'acpi_video1' works but not 'acpi_video0'?

If that's the case, we may need to modify userspace program policy to make it work.

aljosa (aljosa-p) wrote :

Since I'm not an expert, I don't have a clue what are 'acpi_video0' / 'acpi_video1' and if they work or not. But I can provide you with all info you need - just give me instructions how to extract them from my Ubuntu system. Thank you very much for your help.

Kai-Heng Feng (kaihengfeng) wrote :

Let's not hijack this thread - instead, can you file a new bug instead? With logs attached.

aljosa (aljosa-p) wrote :

No problem, please just tell me against which package?
In the meantime, here's the new confusion:
I purged Nvidia 381.09 driver and reinstalled default Nvidia 375.39 via additional drivers.
Now the situation has returned to initially reported problem: everything is ok with adjusting screen brightness, but Ubuntu 17.04 again doesn't save my brightness settings after reboot.

Kai-Heng Feng (kaihengfeng) wrote :

Nvidia 375.39 -> systemd

Nvidia 381.09 -> nvidia

To post a comment you must log in.