Skip to content

Commit

Permalink
wiki: prepare for hextra
Browse files Browse the repository at this point in the history
treewide: replace hint with callout

treewide: remove ToC header

remove <toc>, since it's autogenerated
add missing _index.md

treewide: add frontmatter

treewide: fix headings

add weights

Configuring,Getting Started: expand in sidebar

Add version selector

fix links
  • Loading branch information
fufexan committed Mar 14, 2024
1 parent 27b9014 commit 127ae00
Show file tree
Hide file tree
Showing 63 changed files with 2,026 additions and 1,133 deletions.
36 changes: 20 additions & 16 deletions pages/Configuring/Animations.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Table of contents
---
weight: 9
title: Animations
---

{{< toc >}}

# General
## General

Animations are declared with the `animation` keyword.

Expand All @@ -12,7 +13,8 @@ or
animation=NAME,ONOFF,SPEED,CURVE
```

`ONOFF` can be either 0 or 1, 0 to disable, 1 to enable. _note:_ if it's 0, you can omit further args.
`ONOFF` can be either 0 or 1, 0 to disable, 1 to enable. _note:_ if it's 0, you
can omit further args.

`SPEED` is the amount of ds (1ds = 100ms) the animation will take

Expand All @@ -23,15 +25,15 @@ animation=NAME,ONOFF,SPEED,CURVE
The animations are a tree. If an animation is unset, it will inherit its
parent's values. See [the animation tree](#animation-tree).

## Examples
### Examples

```ini
animation=workspaces,1,8,default
animation=windows,1,10,myepiccurve,slide
animation=fade,0
```

## Animation tree
### Animation tree

```txt
global
Expand All @@ -53,7 +55,7 @@ global
↳ specialWorkspace - styles: same as workspaces
```

# Curves
## Curves

Defining your own Bezier curve can be done with the `bezier` keyword:

Expand All @@ -63,28 +65,30 @@ bezier=NAME,X0,Y0,X1,Y1

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
[here, on cssportal.com](https://www.cssportal.com/css-cubic-bezier-generator/), but
if you want to instead choose from a list of beziers, you can check out [easings.net](https://easings.net).
[here, on cssportal.com](https://www.cssportal.com/css-cubic-bezier-generator/),
but if you want to instead choose from a list of beziers, you can check out
[easings.net](https://easings.net).

## Example
### Example

```ini
bezier=overshot,0.05,0.9,0.1,1.1
```

# Extras
### Extras

For animation style `popin` in `windows`, you can specify a minimum percentage
to start from. For example, the following will make the animation 80% -> 100% of the size:
to start from. For example, the following will make the animation 80% -> 100% of
the size:

```ini
animation=windows,1,8,default,popin 80%
```

For animation styles `slidefade` and `slidefadevert` in `workspaces`, you can specify a movement
percentage. For example, the following will make windows move 20% of the screen width:
For animation styles `slidefade` and `slidefadevert` in `workspaces`, you can
specify a movement percentage. For example, the following will make windows move
20% of the screen width:

```ini
animation=workspaces,1,8,default,slidefade 20%
```

131 changes: 76 additions & 55 deletions pages/Configuring/Binds.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Table of Contents
---
weight: 5
title: Binds
---

{{< toc >}}

# Basic
## Basic

```ini
bind=MODS,key,dispatcher,params
Expand All @@ -16,30 +17,32 @@ bind=SUPER_SHIFT,Q,exec,firefox

will bind opening firefox to <key>SUPER</key> + <key>SHIFT</key> + <key>Q</key>

{{< hint type=tip >}}
{{< callout type=info >}}

For binding keys without a modkey, leave it empty:

```ini
bind=,Print,exec,grim
```

{{< /hint >}}
{{< /callout >}}

_For a complete mod list, see [Variables](../Variables/#variable-types)._
_For a complete mod list, see [Variables](../variables/#variable-types)._

_The dispatcher list can be found in [Dispatchers](../Dispatchers/#list-of-dispatchers)._
_The dispatcher list can be found in
[Dispatchers](../dispatchers/#list-of-dispatchers)._

## Uncommon syms / binding with a keycode

See the
[xkbcommon-keysyms.h header](https://github.com/xkbcommon/libxkbcommon/blob/master/include/xkbcommon/xkbcommon-keysyms.h)
for all the keysyms. The name you should use is the segment after `XKB_KEY_`.

If you are unsure of what your key's name is, you can
use `xev` or `wev` to find that information.
If you are unsure of what your key's name is, you can use `xev` or `wev` to find
that information.

If you want to bind by a keycode, you can just input it in the KEY position with a `code:` prefix,
e.g.:
If you want to bind by a keycode, you can just input it in the KEY position with
a `code:` prefix, e.g.:

```ini
bind=SUPER,code:28,exec,amongus
Expand All @@ -48,9 +51,9 @@ bind=SUPER,code:28,exec,amongus
Will bind <key>SUPER</key> + <key>T</key>. (<key>T</key> is keycode 28.) - You
can also use `xev` or `wev` to find keycodes.

# Misc
## Misc

## Unbind
### Unbind

You can also unbind with `unbind`, e.g.:

Expand All @@ -64,7 +67,7 @@ May be useful for dynamic keybindings with `hyprctl`.
hyprctl keyword unbind SUPER,O
```

## Mouse buttons
### Mouse buttons

You can also bind mouse buttons, by prefacing the mouse keycode with `mouse:`,
for example:
Expand All @@ -75,7 +78,7 @@ bind=SUPER,mouse:272,exec,amongus

will bind it to <key>SUPER</key> + <key>LMB</key>.

## Only modkeys
### Only modkeys

For binding only modkeys, you need to use the TARGET modmask (with the
activating mod) and the `r` flag, e.g.:
Expand All @@ -84,17 +87,18 @@ activating mod) and the `r` flag, e.g.:
bindr=SUPERALT,Alt_L,exec,amongus
```

## Mouse wheel
### Mouse wheel

You can also bind the mouse wheel with `mouse_up` and `mouse_down` (or `mouse_left` and `mouse_right` if your wheel supports horizontal scrolling):
You can also bind the mouse wheel with `mouse_up` and `mouse_down` (or
`mouse_left` and `mouse_right` if your wheel supports horizontal scrolling):

```ini
bind=SUPER,mouse_down,workspace,e-1
```

(control the reset time with `binds:scroll_event_delay`)

## Switches
### Switches

Useful for binding e.g. the lid close/open event:

Expand All @@ -109,9 +113,10 @@ bindl=,switch:off:[switch name],exec,hyprctl keyword monitor "eDP-1, 2560x1600,

check out your switches in `hyprctl devices`.

## Multiple binds to one key
### Multiple binds to one key

You can trigger multiple actions with one keybind by assigning multiple binds to one combination, e.g.:
You can trigger multiple actions with one keybind by assigning multiple binds to
one combination, e.g.:

```
# to switch between windows in a floating workspace
Expand All @@ -121,7 +126,7 @@ bind = SUPER,Tab,bringactivetotop, # bring it to the top

The keybinds will be executed in the order they were created. (top to bottom)

# Bind flags
## Bind flags

`bind` supports flags in this format:

Expand Down Expand Up @@ -162,10 +167,10 @@ bindr=SUPER, SUPER_L, exec, pkill wofi || wofi
# See Mouse Binds section for bindm usage
```

# Mouse Binds
## Mouse Binds

Mouse binds are binds that heavily rely on a mouse, usually its movement.
They will have one less arg, and look for example like this:
Mouse binds are binds that heavily rely on a mouse, usually its movement. They
will have one less arg, and look for example like this:

```ini
bindm=ALT,mouse:272,movewindow
Expand All @@ -177,8 +182,8 @@ with your mouse.
_Available mouse binds_:

| Name | Description | Params |
| -----|------------ |--------|
| movewindow | moves the active window | none |
| --- | --- | --- |
| movewindow | moves the active window | none |
| resizewindow | resizes the active window | 1 - resize and keep window aspect ratio, 2 - resize and ignore `keepaspectratio` window rule/prop, none or anything else for normal resize |

_Common mouse buttons' codes:_
Expand All @@ -190,28 +195,32 @@ RMB -> 273

_for more, you can of course use `wev` to check._

{{< hint type=tip >}}
{{< callout type=info >}}

Mouse binds, despite their name, behave like normal binds. You are free to use
whatever keys / mods you please. When held, the mouse function will be activated.
{{< /hint >}}
whatever keys / mods you please. When held, the mouse function will be
activated.

{{< /callout >}}

# Binding mods
## Binding mods

You can bind a mod alone like this:

```ini
bindr=ALT,Alt_L,exec,amongus
```

# Global Keybinds
## Global Keybinds

### Classic

## Classic
Yes, you heard this right, Hyprland does support global keybinds for ALL apps,
including OBS, Discord, Firefox, etc.

See the [`pass` dispatcher](../Dispatchers/#list-of-dispatchers) for keybinds.
See the [`pass` dispatcher](../dispatchers/#list-of-dispatchers) for keybinds.

Let's take OBS as an example: the "Start/Stop Recording" keybind is set to
Let's take OBS as an example: the "Start/Stop Recording" keybind is set to
<key>SUPER</key> + <key>F10</key>, and you want to make it work globally.

Simply add
Expand All @@ -231,21 +240,24 @@ bind=,mouse:276,pass,^(TeamSpeak 3)$

Will pass MOUSE5 to TeamSpeak3.

{{< hint type=important >}}
{{< callout >}}

XWayland is a bit wonky. Make sure that what you're passing is a "global Xorg
keybind", otherwise passing from a different XWayland app may not work.

It works flawlessly with all native Wayland applications though.
{{< /hint >}}

## DBus Global Shortcuts
{{< /callout >}}

### DBus Global Shortcuts

Some applications may already support the GlobalShortcuts portal in xdg-desktop-portal.
Some applications may already support the GlobalShortcuts portal in
xdg-desktop-portal.

If that's the case, then it's recommended to use this method instead of `pass`.

Open your desired app and issue `hyprctl globalshortcuts`. This will give you a list
of currently registered shortcuts with their description(s).
Open your desired app and issue `hyprctl globalshortcuts`. This will give you a
list of currently registered shortcuts with their description(s).

Choose whichever you like, for example `coolApp:myToggle`

Expand All @@ -255,16 +267,18 @@ Bind it to whatever you want with the `global` dispatcher:
bind = SUPERSHIFT, A, global, coolApp:myToggle
```

{{< hint type=tip >}}
Please note that this function will _only_ work with [XDPH](../../Useful-Utilities/Hyprland-desktop-portal).
{{</ hint >}}
{{< callout type=info >}}

Please note that this function will _only_ work with
[XDPH](../../hyprland-ecosystem/xdg-desktop-portal-hyprland).

# Submaps
{{</ callout >}}

## Submaps

If you want keybind submaps, also known as _modes_ or _groups_, for example if
you press <key>ALT</key> + <key>R</key>, you can enter a "resize" mode,
resize with arrow keys, and leave
with escape, do it like this:
you press <key>ALT</key> + <key>R</key>, you can enter a "resize" mode, resize
with arrow keys, and leave with escape, do it like this:

```ini
# will switch to a submap called resize
Expand All @@ -288,11 +302,16 @@ submap=reset
# keybinds further down will be global again...
```

**IMPORTANT:** do not forget a keybind to reset the keymap while inside it! (In
this case, `escape`)
{{< callout type=warning >}}

Do not forget a keybind to reset the keymap while inside it! (In this case,
`escape`)

{{< /callout >}}

If you get stuck inside a keymap, you can use `hyprctl dispatch submap reset` to
go back. If you do not have a terminal open, tough luck buddy. You have been warned.
go back. If you do not have a terminal open, tough luck buddy. You have been
warned.

You can also set the same keybind to perform multiple actions, such as resize
and close the submap, like so:
Expand All @@ -314,16 +333,18 @@ assigning multiple actions per bind is possible.

## Catch-All

You can also define a keybind via the special `catchall` keyword, which activates no matter which key is pressed.
This can be used to prevent any keys from passing to your active application while in a submap or to exit it immediately when any unknown key is pressed:
You can also define a keybind via the special `catchall` keyword, which
activates no matter which key is pressed. This can be used to prevent any keys
from passing to your active application while in a submap or to exit it
immediately when any unknown key is pressed:

```ini
bind=,catchall,submap,reset
```

# Example Binds
## Example Binds

## Media
### Media

These binds set the expected behavior for regular keyboard media volume keys,
including when the screen is locked:
Expand Down
Loading

0 comments on commit 127ae00

Please sign in to comment.