{ "info": { "author": "Peter Odding", "author_email": "peter@peterodding.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Environment :: X11 Applications", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Desktop Environment", "Topic :: System :: Systems Administration", "Topic :: Utilities" ], "description": "Automatically adjust Linux display brightness\n=============================================\n\nThe ``auto-adjust-display-brightness`` program automatically adjusts the\nbrightness of Linux_ computer displays based on whether it's light or dark\noutside. To get it working you create a configuration file defining your\nphysical location (this is how it figures out whether it's light or dark\noutside) and how to manage the brightness of which displays (so it knows the\nbest way to control the brightness).\n\nI'm a computer programmer and sometimes work through the evening and into the\nnight because it `enables deep concentration`_. During such evenings / nights a\nrecurring irritation was that I had to manually adjust the brightness of my\nlaptop screen and the external monitor attached to my laptop to avoid\nunnecessary `eye strain`_. I'd been using xflux_ for years (it removes the blue\nlight from computer displays during the evening) but that doesn't dim the\nbacklight of my MacBook Air while I found this to be essential to avoid eye\nstrain.\n\n.. contents::\n :local:\n\nInstallation\n------------\n\nThe ``auto-adjust-display-brightness`` program is written in Python and is\navailable on PyPI_ which means installation should be as simple as::\n\n $ pip install auto-adjust-display-brightness\n\nThere's actually a multitude of ways to install Python packages (e.g. the `per\nuser site-packages directory`_, `virtual environments`_ or just installing\nsystem wide) and I have no intention of getting into that discussion here, so\nif this intimidates you then read up on your options before returning to these\ninstructions ;-).\n\nGetting started\n---------------\n\nThe ``auto-adjust-display-brightness`` program requires a configuration file\nthat defines your physical location (this is how it figures out whether it's\nlight or dark outside) and how to manage the brightness of which displays (so\nit knows the best way to control the brightness). As an example here's the\nconfiguration file that I'm using at the moment:\n\n.. code-block:: ini\n\n # My physical location. I determined these values using Google Maps.\n [location]\n latitude = 53.240534499999995\n longitude = 6.614897599999949\n elevation = -2\n\n # The laptop screen of my MacBook Air. This controls the physical backlight\n # which is the best way to reduce the brightness (it also reduces power\n # consumption :-).\n [display:MacBook Air]\n min-brightness = 7\n max-brightness = 70\n sys-directory = /sys/class/backlight/acpi_video0\n\n # My external monitor connected via a display port to DVI adapter. I haven't\n # found any way to configure the physical backlight of this monitor so I'm\n # resorting to a software only modification here (better than nothing).\n [display:ASUS monitor]\n min-brightness = 30\n max-brightness = 60\n output-name = HDMI1\n\nThe configuration file is loaded from the following locations:\n\n- ``~/.auto-adjust-display-brightness.ini``\n- ``/etc/auto-adjust-display-brightness.ini``\n\nThe structure of the configuration file is as follows:\n\n- The ``[location]`` section has three items, all of which are required\n (``latitude``, ``longitude`` and ``elevation``). Some hints on how to find\n the correct values:\n \n - You can find your latitude and longitude on `Google Maps`_.\n\n - Finding your elevation is a bit trickier: Google Maps has the required\n information but doesn't expose it. Fortunately there are `a dozen online\n tools`_ that make it easy to find your elevation.\n\n- Each ``[display:...]`` section defines a computer display whose brightness\n should be controlled by the program:\n \n - The label after the ``display:`` tag is the name of the display (it's used\n in logging output but not otherwise significant, although it should of\n course be unique).\n\n - Displays may have a configured minimum brightness (``min-brightness``) and\n maximum brightness (``max-brightness``). These items default to 0% and 100%\n respectively (the values are percentages).\n\n - Currently two types of brightness control are supported:\n\n 1. The physical brightness of the backlight of laptop screens. This uses\n the Linux sysfs_ virtual file system's `/sys/class/backlight`_ interface\n to control backlight brightness. The only required item is\n ``sys-directory`` which is expected to contain the absolute pathname of\n the directory that controls the backlight brightness of your laptop\n screen (you'll have to figure this out for yourself).\n\n 2. The software brightness of any display using xrandr_ to apply a software\n only modification of display brightness. The main advantage of this\n approach is that it will (should) always work. The disadvantage is that\n it won't dim the back light of the screen. In other words, if you can\n get the other type of brightness control to work for your display it's\n likely preferable.\n\nRunning from cron\n-----------------\n\nTo actually have your display brightness adjusted without manually running any\ncommands you can run ``auto-adjust-display-brightness`` from a cron schedule.\nHere's what I'm currently using::\n\n # /etc/cron.d/auto-adjust-display-brightness:\n # Crontab entries for automatic adjustment of display brightness.\n\n DISPLAY=:0\n HOME=/home/peter\n VIRTUAL_ENV=/home/peter/.virtualenvs/auto-adjust-display-brightness\n\n @reboot root $VIRTUAL_ENV/bin/auto-adjust-display-brightness --force 1>/dev/null 2>&1\n * * * * * root $VIRTUAL_ENV/bin/auto-adjust-display-brightness 1>/dev/null 2>&1\n\nSome notes about this crontab:\n\n- The ``@reboot`` line is responsible for running the program straight after\n boot to avoid the display brightness starting in the wrong state and being\n decreased or increased gradually in the minutes after I've booted my laptop.\n When the program detects that it's being run less than 60 seconds after the\n system has booted it changes the brightness at once instead of gradually.\n\n- The commands are run as ``root`` so that the program has the privileges\n required to write to ``/sys/class/backlight/acpi_video0`` (to control the\n physical backlight of my MacBook Air).\n\n- The ``DISPLAY`` variable enables ``xrandr`` to work even though it's not\n being run from within my GUI environment.\n\n- The ``HOME`` variable enables ``auto-adjust-display-brightness`` to find my\n configuration file without having to move it to\n ``/etc/auto-adjust-display-brightness.ini``. This enables me to track the\n configuration file in my private dotfiles git repository :-).\n\nContact\n-------\n\nThe latest version of ``auto-adjust-display-brightness`` is available on PyPI_\nand GitHub_. For bug reports please create an issue on GitHub_. If you have\nquestions, suggestions, etc. feel free to send me an e-mail at\n`peter@peterodding.com`_.\n\nLicense\n-------\n\nThis software is licensed under the `MIT license`_.\n\n\u00a9 2016 Peter Odding.\n\n.. External references:\n.. _/sys/class/backlight: https://www.kernel.org/doc/Documentation/ABI/stable/sysfs-class-backlight\n.. _a dozen online tools: http://www.google.com/search?q=google+maps+find+altitude\n.. _enables deep concentration: http://swizec.com/blog/why-programmers-work-at-night/swizec/3198\n.. _eye strain: http://en.wikipedia.org/wiki/Asthenopia\n.. _GitHub: https://github.com/xolox/python-auto-adjust-display-brightness\n.. _Google Maps: https://maps.google.com\n.. _Linux: http://en.wikipedia.org/wiki/Linux\n.. _MIT license: http://en.wikipedia.org/wiki/MIT_License\n.. _per user site-packages directory: https://www.python.org/dev/peps/pep-0370/\n.. _peter@peterodding.com: mailto:peter@peterodding.com\n.. _PyPI: https://pypi.python.org/pypi/auto-adjust-display-brightness\n.. _sysfs: http://en.wikipedia.org/wiki/Sysfs\n.. _virtual environments: http://docs.python-guide.org/en/latest/dev/virtualenvs/\n.. _xflux: https://justgetflux.com/linux.html\n.. _xrandr: http://linux.die.net/man/1/xrandr", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/xolox/python-auto-adjust-display-brightness", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "auto-adjust-display-brightness", "package_url": "https://pypi.org/project/auto-adjust-display-brightness/", "platform": "", "project_url": "https://pypi.org/project/auto-adjust-display-brightness/", "project_urls": { "Homepage": "https://github.com/xolox/python-auto-adjust-display-brightness" }, "release_url": "https://pypi.org/project/auto-adjust-display-brightness/1.3.1/", "requires_dist": null, "requires_python": "", "summary": "Automatically adjust Linux display brightness", "version": "1.3.1" }, "last_serial": 2808254, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "62284b7d4968d3010482f43260d52077", "sha256": "1141c0efb9cf0901c3c8dd02aa2a36a0326417764b47bc1e7b603dd12b47e0ab" }, "downloads": -1, "filename": "auto-adjust-display-brightness-1.0.tar.gz", "has_sig": false, "md5_digest": "62284b7d4968d3010482f43260d52077", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11934, "upload_time": "2015-07-15T19:50:44", "url": "https://files.pythonhosted.org/packages/b4/97/0734ed747d2d779d7b5fd00e1ce9d4df0c80c38d0a050fc11d1f7f1516c5/auto-adjust-display-brightness-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "cd73ff4e848a02b29853559b61cfd5cd", "sha256": "ba6fc5c8cdbf22cd0718317f6f445a43f0f7b069d87929fc87887a4999dfd940" }, "downloads": -1, "filename": "auto-adjust-display-brightness-1.0.1.tar.gz", "has_sig": false, "md5_digest": "cd73ff4e848a02b29853559b61cfd5cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11944, "upload_time": "2015-07-15T20:06:20", "url": "https://files.pythonhosted.org/packages/4a/1d/3e59205a6479e59636127ec47bbc73ad4dd0d1896a692e54b836b237e55e/auto-adjust-display-brightness-1.0.1.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "173dd9f1eb393219c5e75c7e79b144b3", "sha256": "3657dcce1812b9ced67abc0bbff3ed275376ac4b6324a742e8efe753d61a143c" }, "downloads": -1, "filename": "auto-adjust-display-brightness-1.1.tar.gz", "has_sig": false, "md5_digest": "173dd9f1eb393219c5e75c7e79b144b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12122, "upload_time": "2015-11-18T22:19:51", "url": "https://files.pythonhosted.org/packages/1e/79/3ce871a61718281f328360c64bad4e6ebbaae23966524fcf7cbb8aa54903/auto-adjust-display-brightness-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "c98b9dcadc200be18ab52c08cf06cecc", "sha256": "36b8be0eecedde249405f83fef23a50cd97987cc049af833c5392a168aef9266" }, "downloads": -1, "filename": "auto-adjust-display-brightness-1.2.tar.gz", "has_sig": false, "md5_digest": "c98b9dcadc200be18ab52c08cf06cecc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12329, "upload_time": "2016-01-26T17:43:28", "url": "https://files.pythonhosted.org/packages/97/40/3cbc749685b6d3792965bc12514151064f5f109b4dccb51197dc03a9f48c/auto-adjust-display-brightness-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "1256027e09d6cd26b5aeded298987d0b", "sha256": "69512f6a3fa33cc5556e00881ef2670d66590eadcac40edd96684c91a60b403c" }, "downloads": -1, "filename": "auto-adjust-display-brightness-1.3.tar.gz", "has_sig": false, "md5_digest": "1256027e09d6cd26b5aeded298987d0b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12477, "upload_time": "2016-01-26T18:03:00", "url": "https://files.pythonhosted.org/packages/16/05/802f1de60476cb89e1fd30020e511e008a2cecd49e94bf34c3e28afa4742/auto-adjust-display-brightness-1.3.tar.gz" } ], "1.3.1": [ { "comment_text": "", "digests": { "md5": "ee9efdf52f2a99c1ae44c9d23897fc2b", "sha256": "10262cb44da9a364e79cdbf0e4b6fe2861a7e98e23a0ca6cb42c160af14227ee" }, "downloads": -1, "filename": "auto-adjust-display-brightness-1.3.1.tar.gz", "has_sig": false, "md5_digest": "ee9efdf52f2a99c1ae44c9d23897fc2b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15268, "upload_time": "2017-04-17T11:07:03", "url": "https://files.pythonhosted.org/packages/d5/67/889e793041a08a92802ea942f0d13d7e870aca2413928bfa08e4f4f9cf51/auto-adjust-display-brightness-1.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ee9efdf52f2a99c1ae44c9d23897fc2b", "sha256": "10262cb44da9a364e79cdbf0e4b6fe2861a7e98e23a0ca6cb42c160af14227ee" }, "downloads": -1, "filename": "auto-adjust-display-brightness-1.3.1.tar.gz", "has_sig": false, "md5_digest": "ee9efdf52f2a99c1ae44c9d23897fc2b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15268, "upload_time": "2017-04-17T11:07:03", "url": "https://files.pythonhosted.org/packages/d5/67/889e793041a08a92802ea942f0d13d7e870aca2413928bfa08e4f4f9cf51/auto-adjust-display-brightness-1.3.1.tar.gz" } ] }