Skip to main content
Help improve PyPI by participating in a 5-minute user interface survey!

an auto luxer

Project Description

inspired by lumen <https://github.com/anishathalye/lumen> but written for *nix machines. autolux takes a screenshot every few seconds, figures out the ‘average value’ of the resulting image (the luminence) and changes the screen brightness based on the screen’s contents.

installation

pip install autolux

dependencies

  • python2 (not python3)
  • python-daemon (optional, for running as a service)
  • imagemagick (for screenshots + determining average brightness)
  • xdotool (finding focused window)
  • xbacklight (for setting display brightness)

usage

# runs autolux
autolux

or

# running autolux as a service
autolux --daemon

xrandr

if your display does not support hardware adjustment through xbacklight, its possible to use xrandr to adjust the brightness via software.

# find out the display of your name using xrandr
xrandr --listmonitors

autolux --xrandr eDP1 # my monitor is named eDP1
autolux --xrandr eDP1 --reset # reset brightness to normal
autolux --xrandr eDP1 --adjust -1 # lower brightness by 1
autolux --xrandr eDP1 --adjust +1 # increase brightness by 1

model

initially, autolux uses linear interpolation to figure out the brightness to map to different luminence inputs. as the brightness is manually adjusted away from its predicted value, autolux records the time of day and luminence values that prompted you to change the brightness level and integrates the new information into its model.

autolux assumes that time of day and screen content are the sole predictors of one’s preferred brightness, but the model could further be improved by adding in several factors, such as ambient light or user active time (as a stand-in for eye strain). because of these and other unknown confounding variables, autolux has an emphasis on quick learning of new preferences and not burning in old ones.

visuals

autolux --vis --plot-bright
# show brightness prediction model
# requires matplotlib
https://cloud.githubusercontent.com/assets/98617/17515134/813b76f0-5deb-11e6-9f27-cb91d3442c45.png
# color is the input luminence. (5K - 65K, lower value is darker screen content)
# x axis is hour (0 - 24, with UTC offset applied)
# y axis is predicted brightness level from the model (0 - 100%)


autolux --vis --plot-luma
# --plot-luma will swap the luma and brightness on the Y axis and colorbar
https://cloud.githubusercontent.com/assets/98617/17578997/f570188c-5f44-11e6-9387-d5e9f08b7cd6.png

Release history Release notifications

This version
History Node

0.0.33

History Node

0.0.32

History Node

0.0.31

History Node

0.0.30

History Node

0.0.29

History Node

0.0.28

History Node

0.0.27

History Node

0.0.26

History Node

0.0.25

History Node

0.0.24

History Node

0.0.23

History Node

0.0.21

History Node

0.0.19

History Node

0.0.18

History Node

0.0.16

History Node

0.0.15

History Node

0.0.14

History Node

0.0.13

History Node

0.0.12

History Node

0.0.11

History Node

0.0.9

History Node

0.0.8

History Node

0.0.7

History Node

0.0.6

History Node

0.0.5

History Node

0.0.4

History Node

0.0.3

History Node

0.0.2

History Node

0.0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
autolux-0.0.33.tar.gz (8.9 kB) Copy SHA256 hash SHA256 Source None Mar 19, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page