GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - moson-mo/smartlight: A small Linux app that dynamically switches keyboard backlight based on mouse and keyboard activity.

BranchesTags
Open more actions menu

Latest commit

 

History

11 Commits
11 Commits

Folders and files

NameName
Last commit message
Last commit date
cmd
cmd
 
 
examples
examples
 
 
internal
internal
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
_config.yml
_config.yml
 
 
build.sh
build.sh
 
 
install.sh
install.sh
 
 

Repository files navigation

smartlight

A small Linux app that dynamically switches keyboard backlight based on mouse and keyboard activity.
When keyboard / mouse are idle for some time, the backlight is turned off.
This duration can be specified as well as the off and on brightness levels.

Note: I've written this app since my thinkpad (T-480s) does not support automatic keyboard brightness control.
So far it has only been tested with that model on Manjaro Linux.

smartlight consists of 3 binaries:

  • smservice

    • The service that set's the backlight level via dbus (org.freedesktop.UPower.KbdBacklight.SetBrightness)
    • Run it as a systemd --user service or set up it up in your startup applications in your favorite DE (see examples folder).
    • Use command line arguments to configure keyboard / mouse timeout and brightness levels
  • smcli

    • command line interface to control smservice
  • smtray

    • tray icon with menu to control smservice
    • set up as a startup application in your DE

Note that smtray requires libappindicator

Building

See buildscript build.sh.

How to get

go get it :)

go get github.com/moson-mo/smartlight

or clone git repo

git clone https://github.com/moson-mo/smartlight.git

or download binaries from the releases page...

Installation

You can use the install script install.sh which copies the binaries to /usr/local/bin/.
Note that you need to build first (or download binaries from release on github).

In order to run things on startup set up smservice (and smtray if you like) as startup application on your favorite desktop environment.

Configuration

On the first start of smservice, a config file is created here ~/.smartlight/config.json, adjust the settings as needed. You can also override those settings by running the application with parameters. Start the service with "-h" to see a list of available options.

Based on

Following libraries are used:

  • godbus - dbus communication

  • gohook - catching keyboard / mouse events

  • systray - tray icon (for smtray)

  • beeep - notifications (from smtray)

  • libappindicator - needed for systray / smtray

Disclaimer

Although this software uses "safe methods" in order to set keyboard backlight levels I wouldn't say it can't kill things. So handle with care.

In no event will we be liable for any loss or damage including without limitation, indirect or consequential loss or damage, or any loss or damage whatsoever arising from loss of data or profits arising out of, or in connection with, the use of this software. (ok, that section I've copied from somewhere else ;-) , but ok it's still valid)

License

A few libraries are used here.
If this project does not comply, please let me know.
I don't know shit about those things. :) , bear with me.

WORK IN PROGRESS

About

A small Linux app that dynamically switches keyboard backlight based on mouse and keyboard activity.

Topics

backlightdbusgogolangkeyboardkeyboard-backlightlightlinuxsmartsmartlighttimeoutx11

Resources

Readme
MIT license
Activity

Stars

2 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.