maximbaz / wluma

Automatic brightness adjustment based on screen contents and ALS
ISC License
665 stars 28 forks source link

[Bug]: wluma refuses to read my config file #90

Closed Mahgozar closed 11 months ago

Mahgozar commented 11 months ago

Steps for reproducing the issue

i copied the example config.toml file from /usr/share/wluma/examples to the /usr/share/wluma folder and then changed it to the following

  GNU nano 7.2                       /usr/share/wluma/config.toml                                  
#[als.iio]
#path = "/sys/bus/iio/devices"
#thresholds = { 0 = "night", 20 = "dark", 80 = "dim", 250 = "normal", 500 = "bright", 800 = "outdo>

[als.webcam]
video = 0
thresholds = { 0 = "night", 15 = "dark", 30 = "dim", 45 = "normal", 60 = "bright", 75 = "outdoors">

# [als.time]
# thresholds = { 0 = "night", 7 = "dark", 9 = "dim", 11 = "normal", 13 = "bright", 16 = "normal", >

# [als.none]

[[output.backlight]]
name = "eDP-1"
path = "/sys/class/backlight/intel_backlight"
capturer = "wlroots"

# [[output.ddcutil]]
# name = "Dell Inc. DELL P2415Q"
# capturer = "none"

[[keyboard]]
name = "keyboard-dell"
path = "/sys/class/leds/asus::kbd_backlight"

# [[keyboard]]
# name = "keyboard-thinkpad"
# path = "/sys/bus/platform/devices/thinkpad_acpi/leds/tpacpi::kbd_backlight"

but whenever i run the script it keeps saying no iio devices found (which of course i dont have those!)

What is the buggy behavior?

it doesn't read the config file

What is the expected behavior?

run according to config

Logs

RUST_LOG=debug wluma

[2023-12-03T21:34:11Z DEBUG wluma] Using Config {
        als: Iio {
            path: "/sys/bus/iio/devices",
            thresholds: {
                0: "night",
                20: "dark",
                250: "normal",
                80: "dim",
                500: "bright",
                800: "outdoors",
            },
        },
        output: [
            Backlight(
                BacklightOutput {
                    name: "eDP-1",
                    path: "/sys/class/backlight/intel_backlight",
                    capturer: Wlroots,
                    min_brightness: 1,
                },
            ),
            Backlight(
                BacklightOutput {
                    name: "keyboard-dell",
                    path: "/sys/bus/platform/devices/dell-laptop/leds/dell::kbd_backlight",
                    capturer: None,
                    min_brightness: 0,
                },
            ),
        ],
    }
[2023-12-03T21:34:11Z WARN  wluma] Skipping 'keyboard-dell' as it might be disconnected: No such file or directory (os error 2)
[2023-12-03T21:34:11Z INFO  wluma] Continue adjusting brightness and wluma will learn your preference over time.
thread 'als' panicked at src/main.rs:112:26:
Unable to initialize ALS IIO sensor: "No iio device found"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

### Version

latest

### Environment

```shell
lsb_release -a; uname -a; pgrep -l sway; pacman -Q | egrep "(wlroots|vulkan|sway|clang|rust)"; dpkg -l | egrep "(wlroots|vulkan|sway|clang|rust)"

LSB Version:    n/a
Distributor ID: Arch
Description:    Arch Linux
Release:    rolling
Codename:   n/a
Linux haku 6.6.3-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Wed, 29 Nov 2023 00:40:39 +0000 x86_64 GNU/Linux
2597 swayidle
2603 swayidle
egrep: warning: egrep is obsolescent; using grep -E
clang 16.0.6-1
lib32-vulkan-icd-loader 1.3.269-1
rustup 1.26.0-5
swayidle 1.8.0-1
swaylock-effects-git r469.4f2234c-1
vulkan-headers 1:1.3.269-1
vulkan-icd-loader 1.3.269-1
vulkan-validation-layers 1.3.268.0-1
wlroots 0.17.0-1
egrep: warning: egrep is obsolescent; using grep -E
maximbaz commented 11 months ago

Hello! The expected location for the config file is actually $XDG_CONFIG_HOME/wluma/config.toml, please try to move your file there 👍

Mahgozar commented 11 months ago

my bad, i didn't find a wluma folder there so i though i maybe have to put it somewhere else. this solved it thank you for the help