<div dir="ltr"><div>
    

    

    

  
  <div><p>Dear all!</p>
<p>As you can read from <a href="https://bugs.launchpad.net/bugs/1270579" target="_blank">bug 1270579 description</a>, I created Ubuntu package for saving and restoring backlight (brightness) level on laptops.</p>
<p>This package installs one file - "/etc/init.d/sysvinit-backlight" (<a href="https://bazaar.launchpad.net/~nrbrtx/+junk/sysvinit-backlight/files" target="_blank">sysvinit script</a>).<br></p><p>
You can install <a href="https://launchpad.net/~nrbrtx/+archive/ubuntu/sysvinit-backlight" target="_blank">my package from PPA</a> with the commands below:<br>
    sudo add-apt-repository ppa:nrbrtx/sysvinit-backlight<br>
    sudo apt-get update<br>
    sudo apt-get install sysvinit-backlight</p>
<p>You can remove it by<br>
    sudo apt-get purge sysvinit-backlight</p>
<p>Please note: if you have installed the previous version of my script, please remove it by<br>
    sudo rm /etc/rc?.d/?25backlight /etc/init.d/brightness /etc/rc?.d/?25brightness</p>
<p>The script functionality is:<br>
   * save backlight (brightness) levels of all video adapters on reboot and shutdown (runlevel 0 and 6)<br>
   * load backlight (brightness) levels for all video adapters on boot (runlevel S and 2)<br>
   * this version supports hybrid graphics</p>
<p>The script options are:<br>
   * sudo service sysvinit-backlight status (show current brightness levels and saved in files values)<br>
   * sudo service sysvinit-backlight start (set saved level from files)<br>
   * sudo service sysvinit-backlight stop (save current level to files)</p>
<p>Known problems:<br>
   * brightness resets to maximum on login to MATE session (may be related to <a rel="nofollow" href="https://github.com/mate-desktop/mate-power-manager/issues/76" target="_blank">https://github.com/mate-desktop/mate-power-manager/issues/76</a>)</p>
<p>Changes:<br>
    I removed all bashisms and made code more clear - thanks to Andreas Mohr (andi).</p>
<p>I tested my package on Ubuntu 12.04.5 LTS, 14.04.2 LTS and Ubuntu 14.10.</p><p><br></p><p>With best regards,<br>Ubuntu user,<br>Norbert.</p></div>
  
  
  


  </div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jan 10, 2015 at 9:24 PM, Nrbrtx <span dir="ltr"><<a href="mailto:nrbrtx@gmail.com" target="_blank">nrbrtx@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div>Dear Ubuntu and Debian developers!<br><br></div>I understand that you are very busy, but laptop users have problems<br></div>with saving and restoring display backlight level in Debian and Ubuntu.<br><br></div><div>Systemd-based distros (Fedora, OpenSuSe, Arch, Sabayon, Mageia) have this functionality out the box (they have <a href="https://github.com/systemd/systemd/commits/56f64d95763a799ba4475daf44d8e9f72a1bd474/src/backlight/backlight.c" target="_blank">systemd-backlight@.service</a>), but sysvinit and upstart not.<br><br></div><div>Here is a list:<br><ul><li>in Arch <span>backlight</span> brightness load and save are provided by systemd (see <a href="https://wiki.archlinux.org/index.php/backlight#systemd-backlight_service" target="_blank">Arch wiki</a>), it is in <a href="https://www.archlinux.org/packages/core/x86_64/systemd/" target="_blank">systemd</a> package.<br></li><li>in OpenSUSE 13.1, OpenSUSE 13.2, CentOS 7, Fedora 20, Fedora 21, Mageia 4 - <a href="http://pkgs.org/search//usr/lib/systemd/systemd-backlight?type=files" target="_blank">systemd package</a></li><li>Sabayon has <span style="font-family:monospace,monospace">/usr/lib/systemd/systemd-<span>backlight</span></span> service</li><li><span style="color:rgb(0,0,0)"><span style="background-color:rgb(255,255,255)">ALT Linux p7 has systemd, but does not have </span></span><span style="font-family:monospace,monospace">/usr/lib/systemd/systemd-<span>backlight</span></span> service</li><li>in Debian <a href="https://packages.debian.org/search?suite=jessie&arch=any&mode=path&searchon=contents&keywords=systemd-backlight" target="_blank">Jessie</a> and Debian <a href="https://packages.debian.org/search?suite=sid&arch=any&mode=path&searchon=contents&keywords=systemd-backlight" target="_blank">sid</a> there is <span style="font-family:monospace,monospace">/usr/lib/systemd/systemd-<span>backlight</span></span> service</li><li>in Ubuntu <a href="http://packages.ubuntu.com/search?searchon=contents&keywords=systemd-backlight&mode=filename&suite=utopic&arch=any" target="_blank">Utopic</a> and Ubuntu <a href="http://packages.ubuntu.com/search?searchon=contents&keywords=systemd-backlight&mode=filename&suite=vivid&arch=any" target="_blank">Vivid</a> there is <span style="font-family:monospace,monospace">/usr/lib/systemd/systemd-<span>backlight</span></span> service</li></ul><p>There is no <span>backlight</span> load/save functionality in (neither upstart nor systemd):</p><ul><li>Ubuntu Lucid</li><li>Ubuntu Precise</li><li>Ubuntu Trusty</li><li>Debian Wheezy</li><li>Debian Squeeze</li></ul><p>So it seems that modern distros have <span>backlight</span> load/save functionality via <a href="http://www.freedesktop.org/software/systemd/man/systemd-backlight@.service.html" target="_blank">systemd-<span>backlight</span> service</a>, but older systems does not have this functionality at all.</p><p><br></p>This problem is well-described on launchpad (see <a href="http://bugs.launchpad.net/bugs/1270579" target="_blank">bug 1270579</a> ) and on<br></div>AskUbuntu (see <a href="http://askubuntu.com/questions/151651/brightness-is-reset-to-maximum-on-every-restart/227553#227553" target="_blank">my comment</a> on it). Around 160 users are affected.<br></div><br>Steps to reproduce:<br>
1. User boots laptop (cold boot, not wake from suspend)<br>
2. User sets comfortable backlight level<br>
3. User ends his/her work by shutting down the laptop (not suspend, so backlight level is not saved)<br>
4. Go to 1 (another cold boot with resetted backlight level).<br></div><div><br></div>I prepared draft version for saving and restoring display backlight level on laptops - it is saved on launchpad (<a href="https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/1270579/+attachment/4288756/+files/upstart_brightness.tar.gz" target="_blank">upstart_brightness.tar.gz archive</a> , see <a href="https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/1270579/comments/18" target="_blank">comment #18 on launchpad</a>) and may be installed to the system manually with<br>     sudo tar -zxvf upstart_brightness.tar.gz -C /<br><br></div><div>My script was tested on Ubuntu 12.04 and Ubuntu 14.04 - see reports on <a href="http://askubuntu.com/questions/151651/brightness-is-reset-to-maximum-on-every-restart/227553#227553" target="_blank">AskUbuntu</a>, <a href="https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/1270579/comments/22" target="_blank">Launchpad</a> and <a href="http://forum.ubuntu.ru/index.php?topic=255145.0;all" target="_blank">forum.ubuntu.ru</a> on laptops with discrete, integrated and hybrid graphics card.<br></div><br>Please reply to this message if you are interested in such init-script.<br><br>Thank you!<br><br><br>With best regards,<br>Debian and Ubuntu user,<br>Norbert.<br><br>P.S. I found interesting projects for the same purpose - first is named Light and hosted on <a href="https://github.com/haikarainen/light" target="_blank">GitHub</a> (previously known as <a href="http://haikarainen.dotgeek.org/lightscript/" target="_blank">LightScript</a>), second is named <a href="http://xyne.archlinux.ca/projects/relight/" target="_blank">Relight</a>. But I think that init-script approach is better.<br></div></div>
</blockquote></div><br></div></div>