Git Product home page Git Product logo

macbook-lighter's Introduction

mackbook-lighter

MacBook keyboard and screen backlight adjust on the ambient light. Internally, macbook-lighter reads the following files:

  • /sys/devices/platform/applesmc.768/light
  • /sys/class/backlight/intel_backlight/brightness
  • /sys/class/backlight/intel_backlight/max_brightness
  • /sys/class/leds/smc::kbd_backlight/brightness
  • /sys/class/leds/smc::kbd_backlight/max_brightness

So you're expected to install corresponding Nvidia/Intel drivers first.

Setup

All commands including macbook-lighter-kbd, macbook-lighter-screen will be available with sudo previledge once macbook-lighter finished install.

To use in non-root environment such as xbindkeys, it's recommended to setup an "udev" rule to allow users in the "video" group to set the backlights. Place a file /etc/udev/rules.d/90-backlight.rules containing:

SUBSYSTEM=="backlight", ACTION=="add", \
  RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness", \
  RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"

And a file /etc/udev/rules.d/91-leds.rules containing:

SUBSYSTEM=="leds", ACTION=="add", \
  RUN+="/bin/chgrp video /sys/class/leds/%k/brightness", \
  RUN+="/bin/chmod g+w /sys/class/leds/%k/brightness"

Usage

# Increase keyboard backlight by 50
macbook-lighter-kbd --inc 50
# Increase screen backlight by 50
macbook-lighter-screen --inc 50
# Set screen backlight to max
macbook-lighter-screen --max
# start auto adjust daemon
systemctl start macbook-lighter
# start auto adjust interactively, root previlege needed
macbook-lighter-ambient

Tested MacBook Versions

  • MacBook Pro Late 2013 (11,1)
  • Macbook Air 2012

macbook-lighter's People

Contributors

harttle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

macbook-lighter's Issues

intel_backlight is not found

hi, when I'm tiring to use it, keyboard's light is working perfectly, but screen brightness can not be controlled, it said: /sys/class/backlight/intel_backlight/brightness: No such file or directory. after checking I found acpi_video0 rather than intel_backlight.
my device is macbook air 2012 11.
Could you please help me with this problem? Thanks!

udev rules do not work

Im successfully running this on a 2012 MacBook Air on ArchLinux, however I cannot get the udev rules to work. Ive gone through some basic troubleshooting for udev but no luck so far. Any suggestions are appreciated, but having the tool be able to run without root access would be a great enhancement feature so its easy to integrate this tool into a keybinding

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.