Coder Social home page Coder Social logo

agucova / kbdlight Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 60 KB

๐Ÿ’ก Program to control keyboard brightness

License: GNU General Public License v3.0

C 63.77% Makefile 8.65% M4 13.07% Shell 0.29% Roff 14.22%
keyboard brightness-control brightness-adjustment brightness command-line-tool

kbdlight's Introduction

Note: This is an abandoned fork of kbdlight, a now-extinct utility. The code is not mine.

kbdlight ๐Ÿ’ก

About

This command-line utility allows the user to change the brightness of a backlit keyboard in GNU/Linux.

The main advantage over alternatives like upower is the lack of unnecessary dependencies and libraries, as well as simplicity of operation. (full of UNIX goodness!)

How it works

The program works in userspace by changing the value in the brightness file provided by the kernel in /sys/class/leds (see here for details).

For this to work, the kernel must support this type of control, the user must have appropiate permissions (in most distros, the video group is sufficient) and the hardware must expose the backlight to the kernel.

Installation

User Permissions

Add user to the video group:

sudo usermod -aG video $USER

Then log out and back in for the permissions to refresh.

Packages

If you are using Arch Linux, you can install the AUR package for automatic installation here. If you are instead using another distro, you'll need to build and compile the program yourself, check the next section for this.

Manual

You can build the program by yourself using make:

git clone https://github.com/glats/kbdlight.git
cd kbdlight
./autogen.sh
./configure
make
sudo make install # Install to the appropiate path.

Usage

kbdlight [OPTIONS]

Options:
  -i          Increase keyboard brightness (by one)
  -d          Decrease keyboard brightness (by one)
  -c          Display current brightness
  -h          Display help.

Hotkey

You can bind standard keys to increase/decrease the keyboard brightness by binding XF86KbdBrightnessUp to kbdlight -i and XF86KbdBrightnessDown to kbdlight -d.

Notes

I wrote this because I didn't wanna use a program with a lot of dependencies to do such a simple task like control the brightness. This idea started while trying to find a minimalist program for my workstation at home, in this research I found light, a simple program that allows you to control the display brightness without extra libraries. Inspired by this I tried to find something similar for keyboard backlights without success, so I decided to start learning C while writing this program.

This is my first project in C so please be nice! Feel free to start an issue or a pull request.

kbdlight's People

Contributors

agucova avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

elizaminelli

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.