[Pkg-sysvinit-devel] Display backlight level save and restore as a init-script / upstart job for laptops

Nrbrtx nrbrtx at gmail.com
Sat Jan 10 18:25:26 UTC 2015


Dear Ubuntu and Debian developers!

I understand that you are very busy, but laptop users have problems
with saving and restoring display backlight level in Debian and Ubuntu.

Systemd-based distros (Fedora, OpenSuSe, Arch, Sabayon, Mageia) have this
functionality out the box (they have systemd-backlight at .service
<https://github.com/systemd/systemd/commits/56f64d95763a799ba4475daf44d8e9f72a1bd474/src/backlight/backlight.c>),
but sysvinit and upstart not.

Here is a list:

   - in Arch backlight brightness load and save are provided by systemd
   (see Arch wiki
   <https://wiki.archlinux.org/index.php/backlight#systemd-backlight_service>),
   it is in systemd
   <https://www.archlinux.org/packages/core/x86_64/systemd/> package.
   - in OpenSUSE 13.1, OpenSUSE 13.2, CentOS 7, Fedora 20, Fedora 21,
   Mageia 4 - systemd package
   <http://pkgs.org/search//usr/lib/systemd/systemd-backlight?type=files>
   - Sabayon has /usr/lib/systemd/systemd-backlight service
   - ALT Linux p7 has systemd, but does not have /usr/lib/systemd/systemd-
   backlight service
   - in Debian Jessie
   <https://packages.debian.org/search?suite=jessie&arch=any&mode=path&searchon=contents&keywords=systemd-backlight>
   and Debian sid
   <https://packages.debian.org/search?suite=sid&arch=any&mode=path&searchon=contents&keywords=systemd-backlight>
   there is /usr/lib/systemd/systemd-backlight service
   - in Ubuntu Utopic
   <http://packages.ubuntu.com/search?searchon=contents&keywords=systemd-backlight&mode=filename&suite=utopic&arch=any>
   and Ubuntu Vivid
   <http://packages.ubuntu.com/search?searchon=contents&keywords=systemd-backlight&mode=filename&suite=vivid&arch=any>
   there is /usr/lib/systemd/systemd-backlight service

There is no backlight load/save functionality in (neither upstart nor
systemd):

   - Ubuntu Lucid
   - Ubuntu Precise
   - Ubuntu Trusty
   - Debian Wheezy
   - Debian Squeeze

So it seems that modern distros have backlight load/save functionality via
systemd-backlight service
<http://www.freedesktop.org/software/systemd/man/systemd-backlight@.service.html>,
but older systems does not have this functionality at all.


This problem is well-described on launchpad (see bug 1270579
<http://bugs.launchpad.net/bugs/1270579> ) and on
AskUbuntu (see my comment
<http://askubuntu.com/questions/151651/brightness-is-reset-to-maximum-on-every-restart/227553#227553>
on it). Around 160 users are affected.

Steps to reproduce:
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 resetted backlight level).

I prepared draft version for saving and restoring display backlight level
on laptops - it is saved on launchpad (upstart_brightness.tar.gz archive
<https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/1270579/+attachment/4288756/+files/upstart_brightness.tar.gz>
, see comment #18 on launchpad
<https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/1270579/comments/18>)
and may be installed to the system manually with
     sudo tar -zxvf upstart_brightness.tar.gz -C /

My script was tested on Ubuntu 12.04 and Ubuntu 14.04 - see reports on
AskUbuntu
<http://askubuntu.com/questions/151651/brightness-is-reset-to-maximum-on-every-restart/227553#227553>,
Launchpad
<https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/1270579/comments/22>
and forum.ubuntu.ru <http://forum.ubuntu.ru/index.php?topic=255145.0;all>
on laptops with discrete, integrated and hybrid graphics card.

Please reply to this message if you are interested in such init-script.

Thank you!


With best regards,
Debian and Ubuntu user,
Norbert.

P.S. I found interesting projects for the same purpose - first is named
Light and hosted on GitHub <https://github.com/haikarainen/light>
(previously known as LightScript
<http://haikarainen.dotgeek.org/lightscript/>), second is named Relight
<http://xyne.archlinux.ca/projects/relight/>. But I think that init-script
approach is better.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-sysvinit-devel/attachments/20150110/a43ab431/attachment.html>


More information about the Pkg-sysvinit-devel mailing list