Skip to content

Commit

Permalink
Merge pull request #8 from marcelohdez/manpages
Browse files Browse the repository at this point in the history
Add a manpage
  • Loading branch information
marcelohdez authored Jul 27, 2024
2 parents 2e305d8 + 383b615 commit a2386e5
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/rust.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Rust
name: CI

on:
push:
Expand All @@ -18,7 +18,7 @@ jobs:
- name: Dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y libxkbcommon-dev libwayland-dev
sudo apt-get install -y libxkbcommon-dev libwayland-dev scdoc
- name: Lint
uses: wearerequired/lint-action@v2
with:
Expand All @@ -28,3 +28,5 @@ jobs:
run: cargo build --locked --verbose
- name: Test locked
run: cargo test --locked --verbose
- name: Test manpages
run: scdoc <man/*.scd >/dev/null
65 changes: 65 additions & 0 deletions man/dim.1.scd
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
DIM(1)

# NAME

dim - A Wayland screen dimmer.

# USAGE

dim [OPTIONS]

# DESCRIPTION

dim requires a Wayland compositor with suport for the single pixel buffer
protocol, e.g. Sway 1.8+, river, Hyprland.

Upon running, dim will create a black overlay with the given alpha (see
OPTIONS) and wait for the given duration (see OPTIONS). If any mouse, touch or
keyboard input is detected, an error will be thrown. Otherwise, when the
duration is reached without input, dim will quit successfully, allowing you to
chain commands. For example, if using `swayidle` you may set:

```
timeout 270 'dim && swaylock'
```

Making it so at 270 seconds, or 5 minutes, dim is run, and if no input is
detected after its timeout, swaylock will be run, locking the screen.

# OPTIONS

\-d, --duration <DURATION>
Set the duration in seconds. 0 Will be considered as infinite. The default is
30.

\-a, --alpha <ALPHA>
Set the *alpha* value of the overlay, 0.0 being transparent and 1.0 being
solid black. Default is 0.5.

\--gen-completions <PATH>
Generates completions for all supported shells at the given path.

\-c, --config <PATH>
Read config file at given PATH instead of default location (see CONFIGURATION
below.)

\-h, --help
Print help information

\-V, --version
Print the binary's version

# CONFIGURATION

dim can be configured through a TOML configuration file, which is by default
looked for at `$XDG_CONFIG_HOME/dim/config.toml`, or, if `$XDG_CONFIG_HOME` is
not set, it will instead default to searching at `~/.config/dim/config.toml`.

The options set here will be overriden by any arguments passed in. Valid
options are alpha and duration as seen above, example config:

```
# i am a comment!
duration = 30
alpha = 0.5
```

0 comments on commit a2386e5

Please sign in to comment.