mirror of
https://github.com/hyprwm/hyprland-wiki.git
synced 2026-05-08 08:38:01 +02:00
keywords done
This commit is contained in:
parent
16d6d40c31
commit
22786c8272
9 changed files with 88 additions and 182 deletions
20
content/Configuring/Autostart.md
Normal file
20
content/Configuring/Autostart.md
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
weight: 11
|
||||
title: Autostart
|
||||
---
|
||||
|
||||
Autostarting apps can be done by executing things on the `hyprland.start` event:
|
||||
|
||||
```lua
|
||||
hl.on("hyprland.start", function ()
|
||||
hl.exec_cmd(terminal)
|
||||
hl.exec_cmd("nm-applet")
|
||||
hl.exec_cmd("waybar & hyprpaper & firefox")
|
||||
end)
|
||||
```
|
||||
|
||||
`hl.exec_cmd()` will spawn an asynchronous process, so there is no need for `& disown` at the end.
|
||||
|
||||
In the same vein, you can spawn processes on exit by listening to `hyprland.shutdown`.
|
||||
|
||||
See more about `hl.on` over at [Expanding Functionality](../Expanding-functionality)
|
||||
45
content/Configuring/Devices.md
Normal file
45
content/Configuring/Devices.md
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
---
|
||||
weight: 11
|
||||
title: Devices
|
||||
---
|
||||
|
||||
For global device configs, check the [Variables](../Variables) page. This page
|
||||
will focus on per-device configs.
|
||||
|
||||
A basic per-device config is done via the `hl.device()` fn:
|
||||
|
||||
```lua
|
||||
hl.device({
|
||||
name = "my-epic-keyboard",
|
||||
sensitivity = -0.5
|
||||
})
|
||||
```
|
||||
|
||||
The `name` can be easily obtained by checking the output of `hyprctl devices`.
|
||||
|
||||
Inside of it, put your config options. All options from the `input` category
|
||||
(and all subcategories, e.g. `input.touchpad`) can be put inside, **EXCEPT**:
|
||||
|
||||
- `force_no_accel`
|
||||
- `follow_mouse`
|
||||
- `float_switch_override_focus`
|
||||
|
||||
You can also use the `output` setting for tablets to bind them to outputs.
|
||||
Remember to use the name of the `Tablet` and not `Tablet Pad` or `Tablet Tool`.
|
||||
|
||||
Additional properties only present in per-device configs:
|
||||
|
||||
- `enabled` -> (only for mice / touchpads / touchdevices / keyboards)
|
||||
- enables / disables the device (connects / disconnects from the on-screen cursor)
|
||||
- default: Enabled
|
||||
- `keybinds` -> (only for devices that send key events)
|
||||
- enables / disables keybinds for the device
|
||||
- default: Enabled
|
||||
|
||||
> [!NOTE]
|
||||
> Per-device layouts will by default not alter the keybind keymap, so for example
|
||||
> with a global keymap of `us` and a per-device one of `fr`, the keybinds will
|
||||
> still act as if you were on `us`.
|
||||
>
|
||||
> You can change this behavior by setting `resolve_binds_by_sym = 1`. In that case
|
||||
> you'll need to type the symbol specified in the bind to activate it.
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
weight: 12
|
||||
weight: 20
|
||||
title: Dwindle Layout
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -90,6 +90,24 @@ Hyprland exposes a bunch of convenience functions:
|
|||
- `hl.get_workspace_windows(workspace_selector)`
|
||||
- `hl.get_current_submap()`
|
||||
- `hl.version()`
|
||||
- `hl.exec_cmd()`
|
||||
|
||||
### Timers
|
||||
|
||||
You can spawn and manage timers via `hl.timer()`:
|
||||
|
||||
```lua
|
||||
local demoTimer = hl.timer(function()
|
||||
print("hello from timer")
|
||||
end, { timeout = 1000, type = "repeat" })
|
||||
|
||||
demoTimer:set_enabled(false)
|
||||
|
||||
hl.bind("SUPER + X", function()
|
||||
-- toggle the timer
|
||||
demoTimer:set_enabled(not demoTimer:is_enabled())
|
||||
end)
|
||||
```
|
||||
|
||||
### Combining it all
|
||||
|
||||
|
|
|
|||
|
|
@ -1,177 +0,0 @@
|
|||
---
|
||||
weight: 3
|
||||
title: Keywords
|
||||
---
|
||||
|
||||
Keywords are not variables, but "commands" for more advanced configuring. On
|
||||
this page, you will be presented with some that do not deserve their own page.
|
||||
|
||||
See the sidebar for more keywords to control binds, animations, monitors, et
|
||||
cetera.
|
||||
|
||||
> [!WARNING]
|
||||
> Please remember, that for ALL arguments separated by a comma, if you want to
|
||||
> leave one of them empty, you cannot reduce the number of commas, _unless told
|
||||
> otherwise in a specific section_:
|
||||
>
|
||||
> ```ini
|
||||
> three_param_keyword = A, B, C # OK
|
||||
> three_param_keyword = A, C # NOT OK
|
||||
> three_param_keyword = A, , C # OK
|
||||
> three_param_keyword = A, B, # OK
|
||||
> ```
|
||||
|
||||
## Executing
|
||||
|
||||
You can execute a shell script on:
|
||||
|
||||
- startup of the compositor
|
||||
- every time the config is reloaded.
|
||||
- shutdown of the compositor
|
||||
|
||||
`exec-once = command` will execute only on launch ([support rules](../Dispatchers/#executing-with-rules))
|
||||
|
||||
`execr-once = command` will execute only on launch
|
||||
|
||||
`exec = command` will execute on each reload ([support rules](../Dispatchers/#executing-with-rules))
|
||||
|
||||
`execr = command` will execute on each reload
|
||||
|
||||
`exec-shutdown = command` will execute only on shutdown
|
||||
|
||||
## Sourcing (multi-file)
|
||||
|
||||
Use the `source` keyword to source another file. Globbing is supported
|
||||
|
||||
For example, in your `hyprland.conf` you can:
|
||||
|
||||
```ini
|
||||
source = ~/.config/hypr/myColors.conf
|
||||
source = ~/.config/hypr/custom/*
|
||||
```
|
||||
|
||||
And Hyprland will enter that file and parse it like a Hyprland config.
|
||||
|
||||
Please note it's LINEAR. Meaning lines above the `source =` will be parsed first,
|
||||
then lines inside `~/.config/hypr/myColors.conf`, then lines below.
|
||||
|
||||
## Gestures
|
||||
|
||||
Use [libinput-gestures](https://github.com/bulletmark/libinput-gestures) with
|
||||
`hyprctl` if you want to expand Hyprland's gestures beyond what's offered in
|
||||
[Variables](../Variables).
|
||||
|
||||
## Per-device input configs
|
||||
|
||||
Per-device config options will overwrite your options set in the `input`
|
||||
section. It's worth noting that ONLY values explicitly changed will be
|
||||
overwritten.
|
||||
|
||||
In order to apply per-device config options, add a new category like this:
|
||||
|
||||
```ini
|
||||
device {
|
||||
name = ...
|
||||
# options ...
|
||||
}
|
||||
```
|
||||
|
||||
The `name` can be easily obtained by checking the output of `hyprctl devices`.
|
||||
|
||||
Inside of it, put your config options. All options from the `input` category
|
||||
(and all subcategories, e.g. `input:touchpad`) can be put inside, **EXCEPT**:
|
||||
|
||||
- `force_no_accel`
|
||||
- `follow_mouse`
|
||||
- `float_switch_override_focus`
|
||||
|
||||
Properties that change names:
|
||||
|
||||
```plain
|
||||
touchdevice:transform -> transform
|
||||
touchdevice:output -> output
|
||||
```
|
||||
|
||||
You can also use the `output` setting for tablets to bind them to outputs.
|
||||
Remember to use the name of the `Tablet` and not `Tablet Pad` or `Tablet tool`.
|
||||
|
||||
Additional properties only present in per-device configs:
|
||||
|
||||
- `enabled` -> (only for mice / touchpads / touchdevices / keyboards)
|
||||
- enables / disables the device (connects / disconnects from the on-screen cursor)
|
||||
- default: Enabled
|
||||
- `keybinds` -> (only for devices that send key events)
|
||||
- enables / disables keybinds for the device
|
||||
- default: Enabled
|
||||
|
||||
Example config section:
|
||||
|
||||
```ini
|
||||
device {
|
||||
name = royuan-akko-multi-modes-keyboard-b
|
||||
repeat_rate = 50
|
||||
repeat_delay = 500
|
||||
middle_button_emulation = 0
|
||||
}
|
||||
```
|
||||
|
||||
Example modifying per-device config values using `hyprctl`:
|
||||
|
||||
```bash
|
||||
hyprctl -r -- keyword device[my-device]:sensitivity -1
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> Per-device layouts will by default not alter the keybind keymap, so for example
|
||||
> with a global keymap of `us` and a per-device one of `fr`, the keybinds will
|
||||
> still act as if you were on `us`.
|
||||
>
|
||||
> You can change this behavior by setting `resolve_binds_by_sym = 1`. In that case
|
||||
> you'll need to type the symbol specified in the bind to activate it.
|
||||
|
||||
## Wallpapers
|
||||
|
||||
The "Hyprland" background you see when you first start Hyprland is **NOT A
|
||||
WALLPAPER**, it's the default image rendered at the bottom of the render stack.
|
||||
|
||||
To set a wallpaper, use a wallpaper utility like
|
||||
[hyprpaper](https://github.com/hyprwm/hyprpaper) or
|
||||
[swaybg](https://github.com/swaywm/swaybg).
|
||||
|
||||
More can be found in [Useful Utilities](../../Useful-Utilities).
|
||||
|
||||
## Setting the environment
|
||||
|
||||
> [!NOTE]
|
||||
> A new environment cannot be passed to already running processes. If you change / add / remove an `env = ` entry
|
||||
> when Hyprland is running, only newly spawned apps will pick up the changes.
|
||||
|
||||
You can use the `env` keyword to set environment variables,
|
||||
e.g:
|
||||
|
||||
```ini
|
||||
env = XCURSOR_SIZE,24
|
||||
```
|
||||
|
||||
You can also add a `d` flag if you want the env var to be exported to D-Bus
|
||||
(systemd only):
|
||||
|
||||
```ini
|
||||
envd = XCURSOR_SIZE,24
|
||||
```
|
||||
|
||||
> [!WARNING]
|
||||
> Hyprland puts the raw string to the env var. You should _not_ add quotes around
|
||||
> the values.
|
||||
>
|
||||
> e.g.:
|
||||
>
|
||||
> ```ini
|
||||
> env = QT_QPA_PLATFORM,wayland
|
||||
> ```
|
||||
>
|
||||
> and _**NOT**_
|
||||
>
|
||||
> ```ini
|
||||
> env = QT_QPA_PLATFORM,"wayland"
|
||||
> ```
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
weight: 13
|
||||
weight: 21
|
||||
title: Master Layout
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
weight: 14
|
||||
weight: 23
|
||||
title: Monocle Layout
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
weight: 13
|
||||
weight: 22
|
||||
title: Scrolling Layout
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
weight: 11
|
||||
weight: 15
|
||||
title: Tearing
|
||||
---
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue