Skip to content

Commit 2ec61d1

Browse files
committed
hyprpaper: rewrite docs for hyprwm/hyprpaper#288
1 parent 8076cff commit 2ec61d1

File tree

1 file changed

+19
-166
lines changed

1 file changed

+19
-166
lines changed

content/Hypr Ecosystem/hyprpaper.md

Lines changed: 19 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -31,166 +31,32 @@ sudo dnf install hyprpaper
3131

3232
{{% /details %}}
3333

34-
{{% details title="Manual" closed="true" %}}
35-
36-
### Dependencies
37-
The development files of these packages need to be installed on the system for `hyprpaper` to build correctly.
38-
(Development packages are usually suffixed with `-dev` or `-devel` in most distros' repos).
39-
40-
- wayland
41-
- wayland-protocols
42-
- pango
43-
- cairo
44-
- file
45-
- libglvnd
46-
- libglvnd-core
47-
- libjpeg-turbo
48-
- libwebp
49-
- hyprlang
50-
- hyprutils
51-
- hyprgraphics
52-
- hyprwayland-scanner
53-
54-
To install all of these in Fedora, run this command:
55-
56-
```sh
57-
sudo dnf install wayland-devel wayland-protocols-devel hyprlang-devel pango-devel cairo-devel file-devel libglvnd-devel libglvnd-core-devel libjpeg-turbo-devel libwebp-devel gcc-c++ hyprutils-devel hyprwayland-scanner
58-
```
59-
60-
On Arch:
61-
62-
```sh
63-
sudo pacman -S ninja gcc wayland-protocols libjpeg-turbo libwebp pango cairo pkgconf cmake libglvnd wayland hyprutils hyprwayland-scanner hyprlang
64-
```
65-
66-
On openSUSE:
67-
68-
```sh
69-
sudo zypper install ninja gcc-c++ wayland-protocols-devel Mesa-libGLESv3-devel file-devel hyprutils-devel hyprwayland-scanner
70-
```
71-
72-
### Building
73-
74-
Building is done via CMake:
75-
76-
```sh
77-
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build
78-
cmake --build ./build --config Release --target hyprpaper -j`nproc 2>/dev/null || getconf _NPROCESSORS_CONF`
79-
```
80-
81-
Install with:
82-
83-
```sh
84-
cmake --install ./build
85-
```
86-
87-
{{% /details %}}
88-
8934
## Configuration
9035

9136
The config file is located at `~/.config/hypr/hyprpaper.conf`. It is not
9237
required.
9338

94-
### List of Dispatchers
95-
96-
| Dispatcher | Description | Params |
97-
| --- | --- | --- |
98-
| `preload` | Preloads an image into memory. | `/home/me/amogus.png` |
99-
| `wallpaper` | Applies `preload`ed images to your monitor(s). | `monitor_name, /home/me/amogus.png` |
100-
| `unload` | Removes `preload`ed images from memory. | `/home/me/amogus.png` \| `all` \| `unused` |
101-
| `reload` | Sets/changes wallpapers without having to `preload` them, effectively automating the process of: `unload`->`preload`->set `wallpaper`. | `/home/me/amogus.png` |
39+
### Setting wallpapers
10240

103-
### The `preload` and `wallpaper` Keywords
104-
105-
Configuration is done using `preload`, which _loads_ an image into memory.
106-
107-
> [!WARNING]
108-
> Note that all image paths must be absolute (or start with `~`).
109-
110-
The `wallpaper` keyword is then used to apply the preloaded image to your monitor(s):
41+
Wallpapers are set as anonymous special categories. Monitor can be left empty for a fallback.
11142

11243
```ini
113-
preload = /home/me/amongus.png
114-
wallpaper = monitor, /home/me/amongus.png
115-
```
44+
wallpaper {
45+
monitor = DP-3
46+
file = ~/myFile.jxl
47+
fit_mode = cover
48+
}
11649

117-
> [!NOTE]
118-
> You can check names and other info for your monitors using `hyprctl monitors`.
50+
wallpaper {
51+
monitor = DP-2
52+
file = ~/myFile2.jxl
53+
fit_mode = cover
54+
}
11955

120-
The `monitor` argument can be left empty to set a wallpaper for all monitors that don't already have one set.
121-
122-
```ini
123-
wallpaper = , /home/me/amongus.png
56+
# ...
12457
```
12558

126-
You can also refer to a monitor by its description by prefixing `desc:` followed by the monitor's description without the (PORT) at the end.
127-
128-
You may add `contain:` or `tile:` before the file path in `wallpaper =` to set the mode to either contain or tile, respectively, instead of cover:
129-
130-
```ini
131-
wallpaper = monitor, contain:/home/me/amongus.png
132-
```
133-
134-
### The `unload` Keyword
135-
136-
You can use `unload` to unload preloaded images.
137-
You can also specify `unload all` to unload all images or `unload unused` to unload images that aren't being used.
138-
139-
### The `reload` Keyword
140-
141-
The `reload` keyword allows you to set or change wallpapers without
142-
having to preload them.
143-
For example, you could have a completely empty hyprpaper config (with [IPC](#ipc) enabled!), and run the below command to quickly set your wallpaper (this example sets the wallpaper for
144-
all monitors):
145-
146-
```sh
147-
hyprctl hyprpaper reload ,"~/amogus.png"
148-
```
149-
150-
Running this command again with a new wallpaper would effectively swap
151-
the wallpaper with the new one, automating the whole preload, set,
152-
unload old sequence.
153-
154-
> [!WARNING]
155-
> `Monitor Specificity`
156-
> Once a monitor has a wallpaper set specifically (e.g., `hyprctl hyprpaper reload "DP-1,~/amogus.png"`),
157-
> it won't be affected by the wildcard (`hyprctl hyprpaper reload ,"~/amogus.png"`).
158-
159-
#### Using `reload` to Randomize Your Wallpaper
160-
161-
You can also use this simple `reload` functionality to randomize your wallpaper. Using a simple script like so would do it very easily:
162-
163-
```bash
164-
#!/usr/bin/env bash
165-
166-
WALLPAPER_DIR="$HOME/wallpapers/"
167-
CURRENT_WALL=$(hyprctl hyprpaper listloaded)
168-
169-
# Get a random wallpaper that is not the current one
170-
WALLPAPER=$(find "$WALLPAPER_DIR" -type f ! -name "$(basename "$CURRENT_WALL")" | shuf -n 1)
171-
172-
# Apply the selected wallpaper
173-
hyprctl hyprpaper reload ,"$WALLPAPER"
174-
```
175-
176-
For a multiple-monitor setup, you can use this modified script that randomizes the wallpaper of your currently focused monitor:
177-
178-
```bash
179-
#!/usr/bin/env bash
180-
181-
WALLPAPER_DIR="$HOME/wallpapers/"
182-
CURRENT_WALL=$(hyprctl hyprpaper listloaded)
183-
# Get the name of the focused monitor with hyprctl
184-
FOCUSED_MONITOR=$(hyprctl monitors -j | jq -r '.[] | select(.focused) | .name')
185-
# Get a random wallpaper that is not the current one
186-
WALLPAPER=$(find "$WALLPAPER_DIR" -type f ! -name "$(basename "$CURRENT_WALL")" | shuf -n 1)
187-
188-
# Apply the selected wallpaper
189-
hyprctl hyprpaper reload "$FOCUSED_MONITOR","$WALLPAPER"
190-
```
191-
192-
Make sure to change the `WALLPAPER_DIR` to your own wallpaper directory. You can then run this
193-
script in your Hyprland config with a keybind.
59+
`fit_mode` is optional and defaults to cover.
19460

19561
### Run at Startup
19662

@@ -202,29 +68,16 @@ If you start Hyprland with [uwsm](../../Useful-Utilities/Systemd-start), you can
20268
| variable | description | type | default |
20369
| --- | --- | --- | --- |
20470
| `splash` | enable rendering of the hyprland splash over the wallpaper | bool | `false` |
205-
| `splash_offset` | how far (in % of height) up should the splash be displayed | float | `2.0` |
206-
| `splash_color` | color to use when rendering splash | color | `55ffffff` |
71+
| `splash_offset` | how far up should the splash be displayed | float | `20` |
72+
| `splash_opacity` | how opaque the splash is | float | `0.8` |
20773
| `ipc` | whether to enable IPC | bool | `true` |
20874

20975
## IPC
21076

211-
hyprpaper supports IPC via `hyprctl`. Every dispatcher mentioned in the
212-
[List of Dispatchers](#list-of-dispatchers) can be called with
213-
`hyprctl hyprpaper <dispatcher> <arg(s)>`.
214-
215-
> [!NOTE]
216-
> Make sure to use valid [hyprlang](./hyprlang.md) syntax when passing arguments to the dispatchers.
217-
218-
Additionally, you can get some info about the current state of hyprpaper with
219-
`listloaded` and `listactive`.
220-
221-
Examples:
77+
hyprpaper supports IPC via `hyprctl`. You can set wallpapers like so:
22278

22379
```sh
224-
hyprctl hyprpaper preload "~/Pictures/myepicpng.png"
225-
hyprctl hyprpaper wallpaper "DP-1,~/Pictures/myepicpng.png"
80+
hyprctl hyprpaper wallpaper '[mon], [path], [fit_mode]
22681
```
22782
228-
```sh
229-
hyprctl hyprpaper listloaded
230-
```
83+
`fit_mode` is optional, and `mon` can be empty for a fallback, just like in the config file.

0 commit comments

Comments
 (0)