hyprland-wiki/pages/FAQ/_index.md

290 lines
8.6 KiB
Markdown
Raw Normal View History

2022-10-20 22:54:34 +02:00
# Table of Contents
2022-10-20 18:56:39 +02:00
{{< toc format=html >}}
2022-08-13 17:00:36 +02:00
2022-10-20 22:54:34 +02:00
# Nothing renders / screen is empty / crash on opening first app
2022-08-12 20:46:36 +02:00
Possible causes:
2022-08-13 17:00:36 +02:00
> Your themes are not set up properly, making apps crash.
2022-08-12 20:46:36 +02:00
Use something like `qt5ct` (QT) and `lxappearance` (GTK) (\*for GTK you can also
set up themes with envvars) to set up your themes.
2022-10-19 15:22:42 +02:00
> Your PC is very, _very_ old.
2022-08-12 20:46:36 +02:00
In that case, see the
2022-08-13 18:45:33 +02:00
[Installation Page](../../Getting-Started/Installation) and
2022-08-12 20:46:36 +02:00
try compiling with LEGACY_RENDERER
2022-10-19 15:22:42 +02:00
_For more info about bugs and crashes, see this_
_[wiki page](../../Crashes-and-Bugs)_
2022-08-12 20:46:36 +02:00
2022-10-20 22:54:34 +02:00
# Me cursor no render?
2022-08-12 20:46:36 +02:00
Are you on NVIDIA? If so, then you have been a naughty boy and haven't listened
2022-08-13 18:45:33 +02:00
to my tips on other pages. Use the `WLR_NO_HARDWARE_CURSORS=1` environment
variable.
2022-08-12 20:46:36 +02:00
2022-10-20 22:54:34 +02:00
# My external monitor is blank / doesn't render / receives no signal (laptop)
For Radeon graphics - unfortunately, it's a bug in wlroots, and not much
can be done other than waiting for the wlroots devs to fix it:
[https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3451](https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3451)
For Nvidia graphics - unfortunately, it's a wlroots issue as well, most likely due to Nvidia's
lack of support and proprietary drivers.
2022-10-19 15:22:42 +02:00
There is a way to fix it that _might_ work for you though:
2022-08-25 20:19:11 +02:00
2022-10-19 15:22:42 +02:00
**Option 1:** Use _only_ the external monitor
2022-08-25 20:19:11 +02:00
By using `WLR_DRM_DEVICES=/dev/dri/card1` (or `card0`) you can force Hyprland to use only your dGPU,
meaning your laptop's screen will be gone but your external one will work.
**Option 2:** Use all outputs, at the cost of battery life.
2022-10-19 15:22:42 +02:00
By switching your laptop to only use the dGPU in the BIOS, you _might_ be able to get everything to work,
2022-08-25 20:19:11 +02:00
at the cost of high battery usage.
2022-10-19 15:22:42 +02:00
_Please note these are highly model-specific and might or might not work. If they don't, you're unfortunately out of luck._
2022-08-25 20:19:11 +02:00
You might try a USB-C to hdmi adapter though, maybe that could route the external monitor through the iGPU.
2022-10-20 22:54:34 +02:00
# How do I screenshot?
2022-08-12 20:46:36 +02:00
Install `grim` and `slurp`
2022-08-12 20:46:36 +02:00
2022-10-19 17:39:16 +02:00
Use a keybind (or execute) `grim -g "$(slurp)"`, select a region. A screenshot
2022-08-12 20:46:36 +02:00
will pop into your `~/Pictures/` (You can configure grim and slurp, see their
2022-10-10 16:22:57 +02:00
GitHub pages).
2022-08-13 18:45:33 +02:00
2022-10-19 17:41:06 +02:00
For a more complete utility, try our own screenshotting utility:
2022-08-13 18:45:33 +02:00
[Grimblast](https://github.com/hyprwm/contrib).
2022-08-12 20:46:36 +02:00
For recording videos, wf-recorder or OBS Studio could be used.
2022-10-19 15:22:42 +02:00
2022-10-20 22:54:34 +02:00
# Screenshare / OBS no worky
Check [Screensharing](../Useful-Utilities/Screen-Sharing).
2022-10-20 22:54:34 +02:00
# How do I change my wallpaper?
2022-08-12 20:46:36 +02:00
2022-08-13 18:45:33 +02:00
See [Wallpapers](../Useful-Utilities/Wallpapers).
2022-08-12 20:46:36 +02:00
2022-10-20 22:54:34 +02:00
# My games work poorly, especially proton ones
2022-08-22 14:44:14 +02:00
Use `gamescope`, tends to fix any and all issues with wayland/Hyprland.
2022-10-20 22:54:34 +02:00
# How heavy is this?
2022-08-12 20:46:36 +02:00
Not that much heavier than Xorg. If you want maximum performance, consider
turning off the blur and animations.
2022-10-20 22:54:34 +02:00
# My monitor no worky
2022-08-12 20:46:36 +02:00
Try changing the mode in your config. If your preferred one doesn't work, try a
lower one. A good way to list all modes is to get `wlr-randr` and do a
`wlr-randr --dryrun`
2022-10-20 22:54:34 +02:00
# How do I update?
2022-08-12 20:46:36 +02:00
2022-10-19 15:22:42 +02:00
Open a terminal where you cloned the repo.
```bash
git pull
sudo make clear
sudo make cleaninstall
```
2022-10-19 15:22:42 +02:00
If you are using the AUR (hyprland-git) package, you
will need to cleanbuild to update the package. Paru
has been problematic with updating before, use Yay.
2022-08-12 20:46:36 +02:00
2022-10-20 22:54:34 +02:00
# How do I screen lock?
2022-08-12 20:46:36 +02:00
Use a wayland-compatible locking utility using WLR protocols, e.g. `swaylock`.
2022-10-20 22:54:34 +02:00
# How do I change me mouse cursor?
2022-08-12 20:46:36 +02:00
Use a tool like for example `lxappearance` to change the GTK cursor.
2022-08-13 01:47:48 +02:00
After that, add `exec-once=hyprctl setcursor [THEME] [SIZE]` to your config and
restart Hyprland.
2022-08-12 20:46:36 +02:00
2022-10-23 00:58:34 +02:00
For QT applications, Hyprland exports XCURSOR_SIZE as 24, which is the default.
You can overwrite this by exporting XCURSOR_SIZE to a different value in your wrapper.
2022-08-13 18:45:33 +02:00
Alternatively, change the config files manually according to the
[XDG specification (Arch Wiki link)](https://wiki.archlinux.org/title/Cursor_themes#Configuration).
2022-08-12 20:46:36 +02:00
Make sure to also edit `~/.config/gtk-4.0/settings.ini` and `~/.gtkrc-2.0` if
_not_ using a tool (like `lxappearance`).
Then, do a `gsettings set $gnome-schema cursor-theme 'theme-name'` and you're
all good!
2022-08-13 18:45:33 +02:00
If it still doesn't work...
2022-08-12 20:46:36 +02:00
2022-10-20 22:54:34 +02:00
# GTK Settings no work / whatever
2022-08-12 20:46:36 +02:00
[https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland](https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland)
2022-10-20 22:54:34 +02:00
# My \[program name\] is freezing
2022-08-12 20:46:36 +02:00
Make sure you have a notification daemon running, for example `dunst`. Autostart
it with the `exec-once` keyword.
2022-10-23 00:58:34 +02:00
# Waybar workspaces no worky???
2022-08-12 20:46:36 +02:00
2022-10-19 17:51:59 +02:00
Waybar has a set of caveats or settings that you need to be aware of. See
[Status bars](../Useful-Utilities/Status-Bars) for solutions.
2022-08-12 20:46:36 +02:00
2022-10-20 22:54:34 +02:00
# How do I autostart my favorite apps?
2022-08-12 20:46:36 +02:00
Using the window rules to assign apps to workspace you can setup a session start
script to open a bunch of applications on various workspaces. The following
method will start these apps silently (i.e. without the flickering from
workspace to workspace) and deassign the rule so that subsequent start of this
app will not start it on the initially assigned workspace (which could be a drag
if e.g. you want kitty to be started on ws 1 while you need kitty to open on any
workspace subsequently).
2022-08-13 19:09:01 +02:00
Put the following in your `hyprland.conf`: (example)
2022-08-12 20:46:36 +02:00
2022-09-24 16:03:37 +02:00
```ini
2022-08-12 20:46:36 +02:00
windowrule=workspace 1 silent,kitty
windowrule=workspace 1 silent,Subl
windowrule=workspace 3 silent,Mailspring
windowrule=workspace 4 silent,firefox
[...]
exec-once=kitty
exec-once=subl
exec-once=mailspring
exec-once=firefox
[...]
exec-once=cleanup_after_start.sh
```
where `cleanup_after_start.sh` script contains:
```bash
2022-08-12 20:46:36 +02:00
sleep 10
hyprctl keyword windowrule "workspace unset,kitty"
hyprctl keyword windowrule "workspace unset,Subl"
hyprctl keyword windowrule "workspace unset,Mailspring"
hyprctl keyword windowrule "workspace unset,firefox"
```
2022-08-13 18:45:33 +02:00
in `sleep 10`, the 10 seconds is of course only a suggestion.
2022-08-12 20:46:36 +02:00
2022-10-20 22:54:34 +02:00
# How do I move my favorite workspaces to a new monitor when I plug it in?
2022-08-12 20:46:36 +02:00
if you want workspaces to automatically go to a monitor upon connection, use the
following:
In hyprland.conf:
2022-09-24 16:03:37 +02:00
```ini
2022-08-12 20:46:36 +02:00
exec-once=handle_monitor_connect.sh
```
where `handle_monitor_connect.sh` is: (example)
```bash
2022-08-12 20:46:36 +02:00
#!/bin/sh
function handle {
if [[ ${1:0:12} == "monitoradded" ]]; then
hyprctl dispatch moveworkspacetomonitor "1 1"
hyprctl dispatch moveworkspacetomonitor "2 1"
hyprctl dispatch moveworkspacetomonitor "4 1"
hyprctl dispatch moveworkspacetomonitor "5 1"
fi
}
socat - UNIX-CONNECT:/tmp/hypr/.socket2.sock | while read line; do handle $line; done
```
if you want workspaces 1 2 4 5 to go to monitor 1 when connecting it.
Please note this requires `socat` to be installed.
2022-10-20 22:54:34 +02:00
# My tablet no worky??
2022-08-12 20:46:36 +02:00
Use [Open Tablet Driver](https://github.com/OpenTabletDriver/OpenTabletDriver)
to configure your tablet. In the future it will be supported in the config.
2022-10-19 15:22:42 +02:00
Until then, OTD is the way to go.
2022-08-12 20:46:36 +02:00
2022-10-20 22:54:34 +02:00
# Some of my apps take a really long time to open...?
2022-08-12 20:46:36 +02:00
2022-10-19 15:22:42 +02:00
_~/.config/hypr/hyprland.conf_
2022-08-12 20:46:36 +02:00
2022-09-24 16:03:37 +02:00
```ini
2022-09-12 15:17:26 +02:00
exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
```
2022-10-19 15:22:42 +02:00
and
2022-10-19 15:22:42 +02:00
2022-09-24 16:03:37 +02:00
```ini
2022-08-12 20:46:36 +02:00
exec-once=systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
```
2022-10-19 15:22:42 +02:00
Make sure that your portals launch _after_ this gets executed. For some people,
2022-10-02 14:44:10 +02:00
they might launch before that has happened.
In such cases, a script like this:
2022-10-19 15:22:42 +02:00
```bash
2022-10-02 14:44:10 +02:00
#!/bin/bash
sleep 4
killall xdg-desktop-portal-wlr
killall xdg-desktop-portal
/usr/lib/xdg-desktop-portal-wlr &
sleep 4
/usr/lib/xdg-desktop-portal &
```
2022-10-19 15:22:42 +02:00
2022-10-02 14:44:10 +02:00
launched with `exec-once` should fix all issues. Adjust the sleep durations to taste.
2022-10-20 22:54:34 +02:00
# How do I export envvars for Hyprland?
2022-08-12 20:46:36 +02:00
As with any Display Server, Xorg included, you should probably make a script to
launch it, for example:
```bash
2022-08-12 20:46:36 +02:00
export AMONG_US=1
exec Hyprland
```
2022-08-13 18:45:33 +02:00
and launch that.
For Display Manager users, you can replace the `exec` entry in
2022-10-19 15:22:42 +02:00
the `.desktop` file to point to your script. You are recommended
to use absolute paths, such as `/home/username/Script` instead of `~/Script`
2022-08-12 20:46:36 +02:00
2022-10-20 22:54:34 +02:00
# I get random white flashes
2022-08-12 20:46:36 +02:00
2022-08-13 18:45:33 +02:00
Try disabling VFR with `misc:no_vfr=1`.
2022-08-12 20:46:36 +02:00
2022-10-20 22:54:34 +02:00
# How do I make Hyprland draw as little power as possible on my laptop?
2022-08-12 20:46:36 +02:00
2022-10-19 15:22:42 +02:00
I assume you already have `damage_tracking` on full. If you don't, change it. It's
2022-08-13 01:47:48 +02:00
heavily advised to use `full` regardless of anything.
2022-08-12 20:46:36 +02:00
2022-10-20 22:54:34 +02:00
## Useful Optimizations
2022-08-12 20:46:36 +02:00
* `decoration:blur_new_optimizations = true`, to use new optimizations for
blurring.
2022-08-12 20:46:36 +02:00
2022-10-19 17:51:59 +02:00
* `decoration:blur = false` and `decoration:drop_shadow = false` to disable
fancy but battery hungry effects.
2022-08-12 20:46:36 +02:00
* `misc:no_vfr = false`, since it'll lower the refresh rate when nothing is happening on-screen.
2022-08-12 20:46:36 +02:00
* `misc:disable_autoreload = true` to stop Hyprland from reloading configuration
file each time that it changes.
2022-09-10 17:30:19 +02:00
2022-10-21 15:31:08 +02:00
# How to fix games with window dancing?
2022-10-21 02:31:35 +02:00
Read [this trick](../Configuring/Uncommon-tips--tricks/#window-dancing).