gamma_daemon

Crates.iogamma_daemon
lib.rsgamma_daemon
version0.2.1
sourcesrc
created_at2023-06-30 18:24:42.72744
updated_at2023-09-24 03:58:08.079471
descriptionChanges screen brightness based on notebook battery life
homepagehttps://github.com/trollLemon/GammaDaemon
repositoryhttps://github.com/trollLemon/GammaDaemon
max_upload_size
id904853
size40,767
Haydn Tamura (trollLemon)

documentation

https://github.com/trollLemon/GammaDaemon

README

GammaDaemon

Auto adjusts screen gamma based on notebook battery life for Linux systems.

Compatibility

GammaDaemon should work with any Linux laptop.

Devices Tested

  • ThinkPad E15 Gen3 with ArchLinux:
    • AC detection: Working

    • Screen brightness change: Working

Installation

Cargo

Run either of the following:

cargo install gamma_daemon
cargo install --path ./

If you do the above method, it has to be in the root folder.

Without Cargo (Custom install location)

First, run

cargo build --release

Then copy the binary to where you want to put it; For example, in /usr/bin/:

$ cp target/release/gamma_daemon /usr/bin/

Udev Rules

To run GammaDaemon without running as root, create a udev rule that will allow users in a certain group to read and write to /sys/class/backlight/(backlight)/brightness. For example, udev rules for users in the video group listed in the documentation for bulbb:

ACTION=="add", SUBSYSTEM=="backlight", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"

For more information, see the bulbb documentation.

Configuration

GammaDaemon is configured in a .toml file. You can specify where to find the config file in a command argument:


gamma_daemon /home/<USER>/config.toml

If no config path is provided, GammaDaemon will look in $USER/.config/GammaDaemon/conf.toml for gamma configurations. If GammaDaemon cannot find this file, it will use a default configuration. Here is an example config:

full = 240
low = 100
low_perc = 25 # out of 100
charging = 255
discharging = 134
unknown = 255
ac_in = 255

Contributing

Any contributions and testing are welcome. Just make a pull request with the changes you want to add.

If you tested this software on a device not listed in the Compatibility section, add the device to the Devices Tested list.

Commit count: 170

cargo fmt