Giter Site home page Giter Site logo

sourav-majumdar-math / bright Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paulswanson/bright

0.0 0.0 0.0 15 KB

A Linux shell script to adjust an Intel backlight with brightness hotkeys (ACPI)

License: GNU General Public License v2.0

Shell 100.00%

bright's Introduction

bright

A Linux shell script to adjust an Intel backlight with brightness hotkeys (ACPI)

Can't adjust your laptop's backlight brightness? Here's the particular problem this script solves, read before use ...

Some laptops manage the screen brightness hotkeys a little different to others.

There are two main parts to your brightness hotkeys:

  • How the key press is handled
  • How the backlight brightness is adjusted

This script deals with the following scenario:

  • Brightness hotkeys are handled by ACPI (not by Xorg)
  • Backlight brightness is handled by Intel Backlight driver (not by xbacklight)

To test if this applies to you, run the following two commands:

    acpi_listen

At the prompt, press your brightness hotkeys. If the result includes "video/brightnessdown" and "video/brightnessup" then they're ACPI hotkeys (not regular keystrokes)

    ls -l /sys/class/backlight/intel_backlight/

If there's a bunch of files then you've probably got the Intel backlight driver

You can simply test this script as is:

    sudo bright.sh up
    sudo bright.sh down

If the screen brightness goes up and down accordingly, congratulations you're almost there.

To bind the brightness hotkeys to this script, attempt the following (pressuming your system is running 'acpid' and is configured in a Debian-style ...

Copy the 'bright.sh' script into /etc/acpi and create event entries under /etc/acpi/events like so:

/etc/acpi/events/brightness-up-support:

   event=video[ /]brightnessup
   action=/etc/acpi/bright.sh "up"

/etc/acpi/events/brightness-down-support:

   event=video[ /]brightnessdown
   action=/etc/acpi/bright.sh "down"

Restart 'acpid' if you can or simply reboot and test out the brightness hotkeys. For me (currently on MX Linux 18.2) it works at both login and session.

See "man acpid" for more details and refer to your distributions documentation; I barely understand this myself.

This script is something I've very much written to solve my own problem. If it helps you then please let me know.

It was tested on MX Linux 18.2 (Debian based) kernel 4.19.0-1-amd64, on a Dell Latitude E7470; good luck to you!

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.