node package manager
Stop wasting time. Easily manage code sharing in your team. Create a free org »

xbacklight

xbacklight

node.js xbacklight wrapper

Install

$ npm install xbacklight --save

Usage

Require module

const xbacklight = require('xbacklight')

Check xbacklight's installed

if(xbacklight.isInstalledSync()) {
  console.log('Woo we\'re ready to rock')
} else {
  console.log('Oh no, try `sudo apt-get install xbacklight` if Debian')
}

Get the current backlight level

xbacklight()
  .then((level) => {
    console.log(level)
  })
  .catch((err) => {
 
  })

Set the backlight by passing a percentage as the first arg

xbacklight(90)
  .then(() => {
    console.log('updated brightness')
  })
  .catch((err) => {
 
  })

Licence

MIT © Ben Evans