Skip to content

Commit

Permalink
Improved documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ezrasingh committed Jan 16, 2024
1 parent 40e479b commit 5e7cda2
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 45 deletions.
65 changes: 65 additions & 0 deletions HELPME.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Help

If you are having trouble setting up the [config.toml](config.toml), here are some tips that helped me identify my system's values.

Here are the system details for the machine I used, along with the command to find them in case your results differ.

```shell
# OS: Ubuntu 23.10 (x86_64)

# ACPI Daemon
❯ acpid -v
acpid-2.0.33

# Display Manager
❯ systemctl status display-manager
● gdm.service - GNOME Display Manager

# XRandR
❯ xrandr -v
xrandr program version 1.5.1
```

## Listing ACPI Devices

To view availble ACPI devices check the following directory `/sys/class/backlight`. For me, it looked like this:

```shell
❯ tre /sys/class/backlight
/sys/class/backlight
└── acpi_video0
```

So in my case I would set `acpi_device = "acpi_video0"` in my [`config.toml`](config.toml)

## Listing Xrandr Displays

By default `xrandr` shows availble displays. For me, it looked like this:

```shell
❯ xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
HDMI-0 disconnected # ...
eDP-1-0 connected primary # <- we only need this part
1920x1080 144.00*+ 60.02
1680x1050 144.00
1280x1024 144.00
# ...
```

So in my case I would set `xrandr_display = "eDP-1-0"`

## Determine ACPI Event Codes

If unsure check by running `sudo acpi_listen` and pressing the corresponding button on your keyboard.

The corresponding event should log onto your shell. You can expect to see something like this (except the comments I added, those are only there to indicate my physical actions):

```shell
❯ sudo acpi_listen
# presses brightess down button
video/brightnessdown BRTDN 00000087 00000000

# presses brightness up button
video/brightnessup BRTUP 00000086 00000000
```
46 changes: 1 addition & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,51 +29,7 @@ Options:

To compile and install the script run `just install`, this will link the `acpi-keyboard-backlight` CLI binary to `/usr/local/bin` directory. Or if you dont want to install onto your system you can try `just cli <args>`.

For help setting up your [`config.toml`](config.toml), continue reading.

### Listing ACPI Devices

To view availble ACPI devices check the following directory `/sys/class/backlight`. For me, it looked like this:

```shell
❯ tre /sys/class/backlight
/sys/class/backlight
└── acpi_video0
```

So in my case I would set `acpi_device = "acpi_video0"` in my [`config.toml`](config.toml)

### Listing Xrandr Displays

By default `xrandr` shows availble displays. For me, it looked like this:

```shell
❯ xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
HDMI-0 disconnected # ...
eDP-1-0 connected primary # <- we only need this part
1920x1080 144.00*+ 60.02
1680x1050 144.00
1280x1024 144.00
# ...
```

So in my case I would set `xrandr_display = "eDP-1-0"`

### Determine ACPI Event Codes

If unsure check by running `sudo acpi_listen` and pressing the corresponding button on your keyboard.

The corresponding event should log onto your shell. You can expect to see something like this (except the comments I added, those are only there to indicate my physical actions):

```shell
❯ sudo acpi_listen
# presses brightess down button
video/brightnessdown BRTDN 00000087 00000000

# presses brightness up button
video/brightnessup BRTUP 00000086 00000000
```
For help setting up your [`config.toml`](config.toml), see the [HELPME.md](HELPME.md) doc.

## Configuration 🔧

Expand Down

0 comments on commit 5e7cda2

Please sign in to comment.