Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Auto toggle keyboard back-lighting on Thinkpads (and maybe other laptops) for Linux

License

NotificationsYou must be signed in to change notification settings

saibotd/tp-auto-kbbl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ThinkPad Auto Keyboard Backlight

tp-auto-kbbl enables keyboard backlighting whenever you start typing. After typing ends (+ timeout), the backlight turns off automatically. It runs in the background on your Linux laptop and checks for keyboard events (default/dev/input/event3).

It should work on any ThinkPad (tested on a 470s) and probably other laptops as well.Let me know if it runs on your device.

To keep CPU/RAM usage low and portability high, I've usedRust for development.This is my first project with it, so if spot anything weird – or plain wrong – let me know! I'm thankful for any advice.

Warning

tp-auto-kbbl works similar to a keylogger (requires root to capture keyboard events system-wide). Always be sure to check the source code.

Usage

Usage: tp-auto-kbbl [options]Options:    -h, --help          prints this help message    -v, --version       prints the version    -n, --no-dim        don't dim before bg turns off    -l, --lazy          don't check actual hw brightness state    -d, --device        specify the device file    -b, --brightness    target keyboard brightness (1-2)    -t, --timeout       time before the bg light turns off

Installation

Download the latestrelease, or clone and build it yourself.

Copy the binary

sudo cp tp-auto-kbbl /usr/bin/

Try it out

tp-auto-kbbl# You'll probably get an error like thisthread 'main' panicked at 'Permission denied (os error 13)', src/main.rs:44:74# Once more as rootsudo tp-auto-kbblInput device ID: bus 0x11 vendor 0x1 product 0x1Evdev version: 10001Input device name: "AT Translated Set 2 keyboard"Phys location: isa0060/serio0/input0Setting brightness to 0

Your backlight should turn off immediately. Try if it turns on when you press any button.If not, check if the input device is correct, you may adjust it via the-d parameter.

Systemd service

# Copy the [unit file](https://raw.githubusercontent.com/saibotd/tp-auto-kbbl/master/tp-auto-kbbl.service)sudo cp tp-auto-kbbl.service /etc/systemd/system/# (optional) Check if the parameters are correctsudo nano /etc/systemd/system/tp-auto-kbbl.service# Reload daemonssudo systemctl daemon-reload# Start the servicesudo systemctl start tp-auto-kbbl# Check if the service runs finesudo systemctl status tp-auto-kbblMär 04 14:02:06 Huffer systemd[1]: Started Auto toggle keyboard back-lighting.Mär 04 14:02:06 Huffer tp-auto-kbbl[343]: Input device ID: bus 0x11 vendor 0x1 pMär 04 14:02:06 Huffer tp-auto-kbbl[343]: Evdev version: 10001Mär 04 14:02:06 Huffer tp-auto-kbbl[343]: Input device name: "AT Translated SetMär 04 14:02:06 Huffer tp-auto-kbbl[343]: Phys location: isa0060/serio0/input0Mär 04 14:02:07 Huffer tp-auto-kbbl[343]: Setting brightness to 0Mär 04 14:02:09 Huffer tp-auto-kbbl[343]: Setting brightness to 2Mär 04 14:02:25 Huffer tp-auto-kbbl[343]: Setting brightness to 0# Finally enable the servicesudo systemctl enable tp-auto-kbbl

Copyright © 2020 Tobias Duehr

About

Auto toggle keyboard back-lighting on Thinkpads (and maybe other laptops) for Linux

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp