Keyboard-backlight - A utility for controlling keyboard backlight for System 76 computers

Overview

keyboard-backlight

A utility for setting keyboard backlight on System 76 devices

This is a VERY BASIC utility for setting backlight brightness and color on System 76 computers. Use at your own risk. I tested this against my 2022 Gazelle.

Compatibility

This software currently only works for single-zone keyboards. Some System76 models have a multi-zone keyboard with different /sys/ files used change the color. If you run this code and it doesn't work, you probably have a multi-zone keyboard, try this:

https://github.com/kevr/system76-kbd-led

Build

I have included the binary as a convenience, but feel free to build it yourself if you don't trust a random guy on the internet. :)

Make sure you have Go installed, then run go build

Usage

This executible requires root permissions to write to files in /sys/. It needs this permission to write to the virtual files that control brightness and color.

-b - Brightness - specify an integer between 0 and 255

-c - Color - Specify a hex value like FF0000

Example:

sudo keyboard-backlight -c FF0000 -b 255

The above command sets your backlight color to red and max brightness.

Caveats

I didn't add any input validation, so be careful what you put in as the arguments. Go's flag library will blow up if you provide non-numeric input for brightness, but I don't check hex input for color.

If not specified, brightness is set to 255 -- the max value.

Color is optional, but you should probably provide a color. I think the color will be white by default, but that could vary from machine to machine.

Running on startup

I use Manjaro. You'll want to research your OS. In my case, I created a file /etc/system/systemd/keyboard.service with these contents:

[Unit]
Description=Script

[Service]
ExecStart=/usr/bin/keyboard-backlight -c FF0000 -b 255

[Install]
WantedBy=multi-user.target 

Make sure that the service file has 644 permissions with sudo chmod 644 /etc/system/systemd/keyboard.service

I built the code and copied the executible into /usr/bin. Make sure it has execute privileges (chmod +x /usr/bin/keyboard-backlight).

You can test the service without restarting by running systemctl start keyboard.service

If that works, you can enable the service at startup:

systemctl enable keyboard.service

License

I licensed this under MIT. See the LICENSE file.

Alternatives

If you don't want to use a Go binary, you can write a bash script that does the exact same thing. It still requires root permissions. See the arch linux docs:

https://wiki.archlinux.org/title/System76_Darter_Pro_6

Owner
Levi McGlone
Levi McGlone
Keyboard-firmware - Go Keyboard Firmware framework

Go Keyboard Firmware framework This is an experimental project that I am using t

BCG 0 Jan 22, 2022
Go application for controlling MuteSync button

goser This is a brief bit of hacking on the MuteSync button so that I could work out and prototype some alternate switching and illumination. Thanks t

Dj Walker-Morgan 1 Jan 15, 2022
Go-turing-i2c-cmdline - Controlling the i2c management bus of the turing pi with i2c works fine

go-turing-i2c-cmdline What is it? Controlling the i2c management bus of the turi

null 1 Jan 22, 2022
User level X Keyboard Grabber

xkg - X Keyboard Grabber Installation go get gopkg.in/xkg.v0 Usage example: package main import ( "fmt" "gopkg.in/xkg.v0" ) func main() { var ke

null 53 Jan 12, 2022
software keyboard for TinyGo

tinykb tinykb is a software keyboard for TinyGo. To use tinykb, it is necessary to implement the driver.Displayer interface. It is still an alpha vers

sago35 1 Oct 27, 2021
Nintendo Switch Joycon keyboard mapper for Linux

joygo Nintendo Switch Joycon keyboard mapper for Linux First, build with -> chmod +x build && ./build Then pair your Joycons to your computer via Blue

SM177Y 1 Nov 13, 2021
Serial to Keyboard converter for Polar's card readers

polar-serial-to-keyboard Serial to Keyboard converter for Polar's card readers Configuration This program is intended to be run as a background proces

null 0 Dec 17, 2021
go.pipeline is a utility library that imitates unix pipeline. It simplifies chaining unix commands (and other stuff) in Go.

go.pipeline go.pipeline is a utility library that imitates unix pipeline. It simplifies chaining unix commands (and other stuff) in Go. Installation g

Song Gao 13 Oct 19, 2021
An open source gitlab linting utility

gitlab-lint API and collector An open source gitlab linting utility Frontend https://github.com/globocom/gitlab-lint-react How to install Install depe

Globo.com 16 Oct 29, 2021
Pango GINX is a GO development utility library for GIN.

Pango GINX Pango GINX is a GO development utility library for GIN. Package Description gindump a http request/response dumper middleware for gin ginfi

Panda Framework 1 Dec 29, 2021
This utility parses stackoverflow data and pushes it to Zinc/Elasticsearch

Gostack This utility parses stackoverflow data and pushes it to Zinc/Elasticsear

Prabhat Sharma 0 Dec 26, 2021
URLHEALTH - a utility function to help ensure that broken urls on documentations can be detected

UrlHealth URLHEALTH is a utility function to help ensure that broken urls on documentations can be detected. We have all followed that greate tutorial

Kiptoon Kipkurui 0 Jan 14, 2022
Go package and associated command line utility to generate random yet human-readable names and identifiers

namegen | What's this? Go package and associated command line utility to generate random yet human-readable names and identifiers. Somewhat inspired b

Anand Varma 0 Jan 22, 2022
:chart_with_upwards_trend: Monitors Go MemStats + System stats such as Memory, Swap and CPU and sends via UDP anywhere you want for logging etc...

Package stats Package stats allows for gathering of statistics regarding your Go application and system it is running on and sent them via UDP to a se

Go Playgound 158 Dec 24, 2021
Real-time Charging System for Telecom & ISP environments

Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments Features Real-time Online/Offline Charging System (OCS). Account Balance

null 346 Jan 23, 2022
Cross-platform file system notifications for Go.

File system notifications for Go fsnotify utilizes golang.org/x/sys rather than syscall from the standard library. Ensure you have the latest version

fsnotify 6.4k Jan 15, 2022
go language generics system

Gotgo This document describes the third iteration of my attempt at a reasonable implementation of generics for go based on the idea of template packag

David Roundy 119 Dec 4, 2021
File system event notification library on steroids.

notify Filesystem event notification library on steroids. (under active development) Documentation godoc.org/github.com/rjeczalik/notify Installation

Rafal Jeczalik 710 Jan 16, 2022
Mobile Blogging System

Mobile Blogging System

mattn 18 Aug 15, 2021