From nrbrtx at gmail.com Sun Mar 29 16:37:38 2015 From: nrbrtx at gmail.com (Nrbrtx) Date: Sun, 29 Mar 2015 19:37:38 +0300 Subject: Display backlight level save and restore as a init-script / upstart job for laptops In-Reply-To: References: Message-ID: Dear all! As you can read from bug 1270579 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. With best regards, Ubuntu user, Norbert. On Sat, Jan 10, 2015 at 9:24 PM, Nrbrtx wrote: > 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 > ), > but sysvinit and upstart not. > > Here is a list: > > - in Arch backlight brightness load and save are provided by systemd > (see Arch wiki > ), > it is in systemd > package. > - in OpenSUSE 13.1, OpenSUSE 13.2, CentOS 7, Fedora 20, Fedora 21, > Mageia 4 - systemd package > > - 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 > > and Debian sid > > there is /usr/lib/systemd/systemd-backlight service > - in Ubuntu Utopic > > and Ubuntu Vivid > > 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 > , > but older systems does not have this functionality at all. > > > This problem is well-described on launchpad (see bug 1270579 > ) and on > AskUbuntu (see my comment > > 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 > > , see comment #18 on launchpad > ) > 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 > , > Launchpad > > and forum.ubuntu.ru > 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 > (previously known as LightScript > ), second is named Relight > . But I think that > init-script approach is better. > -------------- next part -------------- An HTML attachment was scrubbed... URL: