Merge pull request #1 from 0x4nt/main

hyprland-wiki: Paragraphs and syntax correction
This commit is contained in:
NotAShelf 2022-10-19 18:22:59 +03:00 committed by GitHub
commit b76e009bc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 101 additions and 83 deletions

View file

@ -14,25 +14,27 @@ or
animation=NAME,ONOFF,SPEED,CURVE animation=NAME,ONOFF,SPEED,CURVE
``` ```
for example:
```ini
animation=workspaces,1,8,default
animation=windows,1,10,myepiccurve,slide
```
`ONOFF` can be either 0 or 1, 0 to disable, 1 to enable. `ONOFF` can be either 0 or 1, 0 to disable, 1 to enable.
`SPEED` is the amount of ds (1ds = 100ms) the animation will take `SPEED` is the amount of ds (1ds = 100ms) the animation will take
`CURVE` is the bezier curve name, see [curves](#curves). `CURVE` is the bezier curve name, see [curves](#curves).
`STYLE` (optional) is the animation style `STYLE` is the animation style
All the parameters are required, exepct the `STYLE` one.
The animations are a tree. If an animation is unset, it will inherit its The animations are a tree. If an animation is unset, it will inherit its
parent's values. parent's values.
_Animation tree:_ ### Examples
```ini
animation=workspaces,1,8,default
animation=windows,1,10,myepiccurve,slide
```
## Animation tree
``` ```
global global
@ -51,7 +53,7 @@ global
↳ specialWorkspace - styles: same as workspaces ↳ specialWorkspace - styles: same as workspaces
``` ```
## Extras ### Extras
For animation style `popin` in `windows`, you can specify a minimum percentage For animation style `popin` in `windows`, you can specify a minimum percentage
to start from. For example: to start from. For example:
@ -62,7 +64,7 @@ animation=windows,1,8,default,popin 80%
will make the animation 80% -> 100% of the size. will make the animation 80% -> 100% of the size.
## Curves ### Curves
Defining your own Bezier curve can be done with the `bezier` keyword: Defining your own Bezier curve can be done with the `bezier` keyword:
@ -72,9 +74,10 @@ bezier=NAME,X0,Y0,X1,Y1
where `NAME` is the name, and the rest are two points for the Cubic Bezier. A where `NAME` is the name, and the rest are two points for the Cubic Bezier. A
good website to design your bezier can be found good website to design your bezier can be found
[here, on cssportal.com](https://www.cssportal.com/css-cubic-bezier-generator/). [here, on cssportal.com](https://www.cssportal.com/css-cubic-bezier-generator/),
if you want to instead choose from a list of beizers, you can check out [easings.net](https://easings.net).
Example curve: #### Example
```ini ```ini
bezier=overshot,0.05,0.9,0.1,1.1 bezier=overshot,0.05,0.9,0.1,1.1

View file

@ -6,22 +6,20 @@
## Window Rules V1 ## Window Rules V1
You can set window rules for various actions. These are applied on window open! You can set window rules to achieve different behaviours from the active container.
### Syntax
```ini ```ini
windowrule=RULE,WINDOW windowrule=RULE,WINDOW
``` ```
`RULE` is a rule (and a param if applicable) - `RULE` is a rule (and a param if applicable)
- `WINDOW` is a RegEx, either:
- plain RegEx (for matching a window class);
- `title:` followed by a regex (for matching a window's title)
`WINDOW` is a RegEx, either: #### Examples
- plain regex (for matching a window class)
- `title:` followed by a regex (for matching a window's title)
you can get both by inspecting `hyprctl clients`
Examples:
```ini ```ini
windowrule=float,^(kitty)$ windowrule=float,^(kitty)$
@ -50,7 +48,13 @@ xwayland - 0/1
floating - 0/1 floating - 0/1
``` ```
Keep in mind you do _not_ need to define all of them, but you need to define at least one. Keep in mind that you *have* to declare at least one field, but not all.
{{< hint type=tip >}}
To get informations about windows' class, title, if it uses XWayland or its size, you can use `hyprctl client`.
{{< /hint >}}
## Rules ## Rules
@ -77,7 +81,7 @@ Keep in mind you do _not_ need to define all of them, but you need to define at
| pin | pins the window _note: floating only_ | | pin | pins the window _note: floating only_ |
| noanim | disables the animations for the window | | noanim | disables the animations for the window |
_Examples_: #### Examples
```ini ```ini
windowrule = move 100 100,^(kitty)$ windowrule = move 100 100,^(kitty)$

View file

@ -61,7 +61,7 @@ as a driver and using it for a while might give more insight to the more random
bugs. bugs.
When Hyprland crashes, use `coredumpctl` and then `coredumpctl info PID` to see When Hyprland crashes, use `coredumpctl` and then `coredumpctl info PID` to see
the dump. the dump. See the instructions below this paragraph for more info about `coredumpctl`.
I also recommend the amazing command I also recommend the amazing command
@ -71,6 +71,19 @@ watch -n 0.1 "cat /tmp/hypr/$(echo HYPRLAND_INSTANCE_SIGNATURE)/hyprland.log | g
for live logs. (replace `hyprland` with `hyprlandd` for debug builds) for live logs. (replace `hyprland` with `hyprlandd` for debug builds)
### How do I get a coredump?
_These instructions are ONLY for systemd. If you use anything else, you should
know what you're doing._
Launch `coredumpctl` in a terminal. Press <key>END</key> on the keyboard to go
to the end. Note the **last** (the one furthest to the bottom) crash that has
`/usr/bin/Hyprland` as an executable. Remember the PID of it (the first number
after the date in a given line) exit (<key>Ctrl</key>+<key>C</key>) type
`coredumpctl info PID` where `PID` is the remembered PID. Send the entire thing
as a file.
## Nesting Hyprland ## Nesting Hyprland
Hyprland can run nested in a window. For that, make sure you did the following: Hyprland can run nested in a window. For that, make sure you did the following:

View file

@ -53,7 +53,7 @@ You might try a USB-C to hdmi adapter though, maybe that could route the externa
### How do I screenshot? ### How do I screenshot?
Install `grim-git` and `slurp` Install `grim` and `slurp`
Use a keybind (or execute) `grim -g $(slurp)`, select a region. A screenshot Use a keybind (or execute) `grim -g $(slurp)`, select a region. A screenshot
will pop into your `~/Pictures/` (You can configure grim and slurp, see their will pop into your `~/Pictures/` (You can configure grim and slurp, see their
@ -72,10 +72,6 @@ Check [Screensharing](../Useful-Utilities/Screen-Sharing).
See [Wallpapers](../Useful-Utilities/Wallpapers). See [Wallpapers](../Useful-Utilities/Wallpapers).
### My workspace (2, 3, or any other) is like... bugged?
You did the below, unknowingly.
### My games work poorly, especially proton ones ### My games work poorly, especially proton ones
Use `gamescope`, tends to fix any and all issues with wayland/Hyprland. Use `gamescope`, tends to fix any and all issues with wayland/Hyprland.
@ -85,42 +81,25 @@ Use `gamescope`, tends to fix any and all issues with wayland/Hyprland.
Not that much heavier than Xorg. If you want maximum performance, consider Not that much heavier than Xorg. If you want maximum performance, consider
turning off the blur and animations. turning off the blur and animations.
### Blur makes my GPU cry :(
You probably forgot to turn on `decoration:blur_new_optimizations`. Thank me
later.
### My monitor no worky ### My monitor no worky
Try changing the mode in your config. If your preferred one doesn't work, try a 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 lower one. A good way to list all modes is to get `wlr-randr` and do a
`wlr-randr --dryrun` `wlr-randr --dryrun`
### How do I get a coredump?
_These instructions are ONLY for systemd. If you use anything else, you should
know what you're doing._
Launch `coredumpctl` in a terminal. Press <key>END</key> on the keyboard to go
to the end. Note the **last** (the one furthest to the bottom) crash that has
`/usr/bin/Hyprland` as an executable. Remember the PID of it (the first number
after the date in a given line) exit (<key>Ctrl</key>+<key>C</key>) type
`coredumpctl info PID` where `PID` is the remembered PID. Send the entire thing
as a file.
### How do I update? ### How do I update?
Open a terminal where you cloned the repo. Open a terminal where you cloned the repo.
`git pull && sudo make clear && sudo make cleaninstall` ```bash
git pull
sudo make clear
sudo make cleaninstall
```
If you are using the AUR (hyprland-git) package, you If you are using the AUR (hyprland-git) package, you
will need to cleanbuild to update the package. Paru will need to cleanbuild to update the package. Paru
has been problematic with updating before, use Yay. has been problematic with updating before, use Yay.
### Waybar popups render behind the windows??
You have misconfigured Waybar. Make sure the `layer` in the waybar config is set to `top`, and not `bottom`.
### How do I screen lock? ### How do I screen lock?
Use a wayland-compatible locking utility using WLR protocols, e.g. `swaylock`. Use a wayland-compatible locking utility using WLR protocols, e.g. `swaylock`.
@ -132,6 +111,8 @@ Use a tool like for example `lxappearance` to change the GTK cursor.
After that, add `exec-once=hyprctl setcursor [THEME] [SIZE]` to your config and After that, add `exec-once=hyprctl setcursor [THEME] [SIZE]` to your config and
restart Hyprland. restart Hyprland.
If you want to change cursor size on QT, add `XCURSOR_SIZE=[SIZE]` to your wrapper.
Alternatively, change the config files manually according to the Alternatively, change the config files manually according to the
[XDG specification (Arch Wiki link)](https://wiki.archlinux.org/title/Cursor_themes#Configuration). [XDG specification (Arch Wiki link)](https://wiki.archlinux.org/title/Cursor_themes#Configuration).
@ -156,10 +137,6 @@ it with the `exec-once` keyword.
Check [Status bars](../Useful-Utilities/Status-Bars). Check [Status bars](../Useful-Utilities/Status-Bars).
### Waybar doesn't show the active workspace
Use the style for `#workspaces button.active`
### How do I autostart my favorite apps? ### How do I autostart my favorite apps?
Using the window rules to assign apps to workspace you can setup a session start Using the window rules to assign apps to workspace you can setup a session start
@ -188,7 +165,7 @@ exec-once=cleanup_after_start.sh
where `cleanup_after_start.sh` script contains: where `cleanup_after_start.sh` script contains:
```sh ```bash
sleep 10 sleep 10
hyprctl keyword windowrule "workspace unset,kitty" hyprctl keyword windowrule "workspace unset,kitty"
hyprctl keyword windowrule "workspace unset,Subl" hyprctl keyword windowrule "workspace unset,Subl"
@ -211,7 +188,7 @@ exec-once=handle_monitor_connect.sh
where `handle_monitor_connect.sh` is: (example) where `handle_monitor_connect.sh` is: (example)
```sh ```bash
#!/bin/sh #!/bin/sh
function handle { function handle {
@ -255,7 +232,7 @@ they might launch before that has happened.
In such cases, a script like this: In such cases, a script like this:
```sh ```bash
#!/bin/bash #!/bin/bash
sleep 4 sleep 4
killall xdg-desktop-portal-wlr killall xdg-desktop-portal-wlr
@ -267,17 +244,12 @@ sleep 4
launched with `exec-once` should fix all issues. Adjust the sleep durations to taste. launched with `exec-once` should fix all issues. Adjust the sleep durations to taste.
### My cursor in QT apps is too big
Oh no! Anyway, the QT cursor size can be fixed by setting the envvar `XCURSOR_SIZE=24`. You
should probably add it to your exported envvars.
### How do I export envvars for Hyprland? ### How do I export envvars for Hyprland?
As with any Display Server, Xorg included, you should probably make a script to As with any Display Server, Xorg included, you should probably make a script to
launch it, for example: launch it, for example:
```ini ```bash
export AMONG_US=1 export AMONG_US=1
exec Hyprland exec Hyprland
``` ```
@ -297,16 +269,16 @@ Try disabling VFR with `misc:no_vfr=1`.
I assume you already have `damage_tracking` on full. If you don't, change it. It's I assume you already have `damage_tracking` on full. If you don't, change it. It's
heavily advised to use `full` regardless of anything. heavily advised to use `full` regardless of anything.
Optimization options: _Useful Optimizations_
_feel free to ignore any that you find causing issues_ * `decoration:blur_new_optimizations = true`, to use new optimizations for
blurring.
`decoration:blur_new_optimizations = true` * `decoration:blur = false` & `decoration:drop_shadow = false` to disable
fancy but battery hungry effects.
`decoration:blur = false` * `misc:no_vfr = false`, since it has been proven that it consumes less power.
`decoration:drop_shadow = false` * `misc:disable_autoreload = true` to stop Hyprland from reloading configuration
file each time that it changes.
`misc:no_vfr = false`
_possibly_ `misc:disable_autoreload = true`

View file

@ -15,24 +15,50 @@ To compile manually:
Clone the source, cd into it, then do: Clone the source, cd into it, then do:
```sh ```bash
sed -i 's/zext_workspace_handle_v1_activate(workspace_handle_);/const std::string command = "hyprctl dispatch workspace " + name_;\n\tsystem(command.c_str());/g' src/modules/wlr/workspace_manager.cpp sed -i 's/zext_workspace_handle_v1_activate(workspace_handle_);/const std::string command = "hyprctl dispatch workspace " + name_;\n\tsystem(command.c_str());/g' src/modules/wlr/workspace_manager.cpp
meson --prefix=/usr --buildtype=plain --auto-features=enabled --wrap-mode=nodownload build meson --prefix=/usr --buildtype=plain --auto-features=enabled --wrap-mode=nodownload build
meson configure -Dexperimental=true build meson configure -Dexperimental=true build
```
and finally:
```sh
sudo ninja -C build install sudo ninja -C build install
``` ```
If you want to use the workspaces module, it's called `wlr/workspaces`. If you want to use the workspaces module, first, copy the configuration files from
`/etc/xdg/waybar/` into `~/.config/waybar/`. Then, in `~/.config/waybar/conf/` replace
all the references to `sway/workspaces/` with `wlr/workspaces`.
For more info regarding configuration, see For more info regarding configuration, see
[The Waybar Wiki](https://github.com/Alexays/Waybar/wiki). [The Waybar Wiki](https://github.com/Alexays/Waybar/wiki).
### Waybar popups render behind the windows
In `~/.config/waybar/config`, make sure that you have the `layer` configuration
set to `top` and not `bottom`.
### Active workspace doesn't show up
Replace `#workspaces button.focus` with `#wroskapces button.active` in `~/.config/style.css`.
### Scroll through workspaces
Since there are a lot of configurations from `sway/workspaces` missing, you
should deduce some of them by yourself. In the case of scrolling, configure
your module this way:
```json
"wlr/workspaces": {
"format": "{icon}",
"on-scroll-up": "hyprctl dispatch workspace e+1",
"on-scroll-down": "hyprctl dispatch workspace e-1"
},
```
### Clicking on workspace doesn't work!
On the `wlr/workspaces` module, add `"on-click": "activate"`. That's the purpose of
the `sed` command we had to apply before building: the default way to select a
workspace by clicking uses the `swaymsg`'s way, furthermore it is required to edit
this function to make it work with `hyprctl`.
## Eww ## Eww
In order to use [Eww](https://github.com/elkowar/eww), you first have to install In order to use [Eww](https://github.com/elkowar/eww), you first have to install