hyprland-wiki/pages/Hypr Ecosystem/hyprpaper.md

159 lines
4 KiB
Markdown
Raw Permalink Normal View History

---
weight: 1
title: hyprpaper
---
2024-02-19 17:52:58 +01:00
hyprpaper is a fast, IPC-controlled wallpaper utility for Hyprland.
2024-02-19 17:52:58 +01:00
## Installation
{{% details title="Arch" closed="true" %}}
```sh
pacman -S hyprpaper
```
{{% /details %}}
{{% details title="OpenSuse" closed="true" %}}
```sh
zypper install hyprpaper
```
{{% /details %}}
{{% details title="Fedora" closed="true" %}}
```sh
sudo dnf install hyprpaper
```
{{% /details %}}
{{% details title="Manual" closed="true" %}}
### Dependencies
The development files of these packages need to be installed on the system for `hyprpaper` to build correctly.
(Development packages are usually suffixed with `-dev` or `-devel` in most distros' repos).
2024-11-06 19:34:37 +01:00
- wayland
- wayland-protocols
- pango
- cairo
- file
- libglvnd
- libglvnd-core
- libjpeg-turbo
- libwebp
- hyprlang
- hyprutils
- hyprwayland-scanner
To install all of these in Fedora, run this command:
2024-11-06 19:34:37 +01:00
```sh
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
```
On Arch:
2024-11-06 19:34:37 +01:00
```sh
sudo pacman -S ninja gcc wayland-protocols libjpeg-turbo libwebp pango cairo pkgconf cmake libglvnd wayland hyprutils hyprwayland-scanner hyprlang
```
On OpenSUSE:
2024-11-06 19:34:37 +01:00
```sh
sudo zypper install ninja gcc-c++ wayland-protocols-devel Mesa-libGLESv3-devel file-devel hyprutils-devel hyprwayland-scanner
```
### Building
Building is done via CMake:
```sh
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build
cmake --build ./build --config Release --target hyprpaper -j`nproc 2>/dev/null || getconf _NPROCESSORS_CONF`
```
Install with:
```sh
cmake --install ./build
```
{{% /details %}}
2024-02-19 17:52:58 +01:00
## Configuration
The config file is located at `~/.config/hypr/hyprpaper.conf`. It is not
required.
2024-02-19 17:52:58 +01:00
Configuration is done using `preload`, which _loads_ an image into memory. Then,
the `wallpaper` keyword is used to apply the preloaded image to your monitor(s):
2024-02-19 17:52:58 +01:00
```ini
preload = /home/me/amongus.png
2024-07-30 22:44:45 +02:00
wallpaper = monitor, /home/me/amongus.png
2024-02-19 17:52:58 +01:00
```
`monitor` can be left empty to set to all monitors without a set wallpaper:
2024-07-30 22:44:45 +02:00
```ini
wallpaper = , /home/me/amongus.png
```
2024-11-06 19:34:37 +01:00
Monitor names can be checked with `hyprctl monitors`.
2024-11-06 19:34:37 +01:00
Also can be used with `desc:` followed by the monitor's description without the (PORT) at the end.
2024-10-25 13:29:32 +02:00
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:
2024-07-30 22:44:45 +02:00
```ini
wallpaper = monitor, contain:/home/me/amongus.png
```
2024-02-19 17:52:58 +01:00
You can use `unload` to unload preloaded images. You can also specify `unload all`
to unload all images or `unload unused` to unload images that aren't being used.
2024-02-19 17:52:58 +01:00
2024-07-30 22:44:45 +02:00
Also you can use `reload` to unload preloaded image from your monitor(s),
preload another and set it to your monitor(s). It has the same syntax as
`wallpaper` keyword.
### Run at startup
2024-07-30 22:44:45 +02:00
To run hyprpaper at startup edit `hyprland.conf` and add: `exec-once =
hyprpaper`. If you start Hyprland with [uwsm](../../Useful-Utilities/Systemd-start), you can also use `systemctl --user enable --now hyprpaper.service` command.
2024-02-19 17:52:58 +01:00
### Misc options
2024-02-19 17:52:58 +01:00
| variable | description | type | default |
| --- | --- | --- | --- |
2024-02-19 17:52:58 +01:00
| splash | enable rendering of the hyprland splash over the wallpaper | bool | false |
| splash_offset | how far (in % of height) up should the splash be displayed | float | 2.0 |
2024-04-04 21:52:51 +02:00
| splash_color | color to use when rendering splash | color | 55ffffff |
2024-02-19 17:52:58 +01:00
| ipc | whether to enable IPC | bool | true |
## IPC
hyprpaper supports IPC via `hyprctl`. Every dispatcher mentioned in
[Configuration](#configuration) can be called with
`hyprctl hyprpaper <dispatcher> <arg(s)>`.
2024-02-19 17:52:58 +01:00
Additionally, you can get some info about the current state of hyprpaper with
`listloaded` and `listactive`.
2024-02-19 17:52:58 +01:00
Examples:
2024-02-19 17:52:58 +01:00
```sh
hyprctl hyprpaper preload "~/Pictures/myepicpng.png"
hyprctl hyprpaper wallpaper "DP-1,~/Pictures/myepicpng.png"
```
```sh
hyprctl hyprpaper listloaded
```
Please note all paths have to be absolute (or start with `~`).