2024-02-20 21:16:07 +01:00
---
weight: 9
title: Animations
---
2022-10-23 16:35:39 +02:00
2024-02-20 21:16:07 +01:00
## General
2022-09-24 15:32:40 +02:00
Animations are declared with the `animation` keyword.
2022-09-24 16:03:37 +02:00
```ini
2024-07-30 21:59:15 +02:00
animation = NAME, ONOFF, SPEED, CURVE [,STYLE]
2022-09-24 15:32:40 +02:00
```
2024-02-20 21:16:07 +01:00
`ONOFF` can be either 0 or 1, 0 to disable, 1 to enable. _note:_ if it's 0, you
can omit further args.
2022-09-24 15:32:40 +02:00
`SPEED` is the amount of ds (1ds = 100ms) the animation will take
`CURVE` is the bezier curve name, see [curves ](#curves ).
`STYLE` (optional) is the animation style
The animations are a tree. If an animation is unset, it will inherit its
2022-10-23 16:35:39 +02:00
parent's values. See [the animation tree ](#animation-tree ).
2022-09-24 15:32:40 +02:00
2024-02-20 21:16:07 +01:00
### Examples
2022-09-24 15:32:40 +02:00
2022-10-23 16:35:39 +02:00
```ini
2024-07-30 21:59:15 +02:00
animation = workspaces, 1, 8, default
animation = windows, 1, 10, myepiccurve, slide
animation = fade, 0
2022-09-24 15:32:40 +02:00
```
2022-10-23 16:35:39 +02:00
2024-02-20 21:16:07 +01:00
### Animation tree
2022-10-23 16:35:39 +02:00
```txt
2022-09-24 15:32:40 +02:00
global
↳ windows - styles: slide, popin
↳ windowsIn - window open
↳ windowsOut - window close
↳ windowsMove - everything in between, moving, dragging, resizing.
2024-02-28 16:02:22 +01:00
↳ layers - styles: slide, popin, fade
2024-04-04 17:41:36 +02:00
↳ layersIn - layer open
↳ layersOut - layer close
2022-09-24 15:32:40 +02:00
↳ fade
2024-04-04 17:41:36 +02:00
↳ fadeIn - fade in for window open
↳ fadeOut - fade out for window close
2022-09-24 15:32:40 +02:00
↳ fadeSwitch - fade on changing activewindow and its opacity
↳ fadeShadow - fade on changing activewindow for shadows
↳ fadeDim - the easing of the dimming of inactive windows
2024-02-28 16:02:22 +01:00
↳ fadeLayers - for controlling fade on layers
2024-04-04 17:41:36 +02:00
↳ fadeLayersIn - fade in for layer open
↳ fadeLayersOut - fade out for layer close
2023-02-01 22:07:36 +01:00
↳ border - for animating the border's color switch speed
↳ borderangle - for animating the border's gradient angle - styles: once (default), loop
2023-08-17 22:30:43 +02:00
↳ workspaces - styles: slide, slidevert, fade, slidefade, slidefadevert
2024-08-21 14:38:44 +02:00
↳ workspacesIn - styles: same as workspaces
↳ workspacesOut - styles: same as workspaces
2022-09-24 15:32:40 +02:00
↳ specialWorkspace - styles: same as workspaces
2024-08-21 14:38:44 +02:00
↳ specialWorkspaceIn - styles: same as workspaces
↳ specialWorkspaceOut - styles: same as workspaces
2022-09-24 15:32:40 +02:00
```
2024-10-14 02:08:16 +02:00
{{< callout type = warning > }}
Using borderangle style: loop requires Hyprland to constantly push out new frames at [your monitor's hz] times a second which might put stress on your CPU/GPU and affect battery life. This will be applied even if animation are disabled or borders are not visible.
{{< / callout > }}
2024-02-20 21:16:07 +01:00
## Curves
2022-09-24 15:32:40 +02:00
Defining your own Bezier curve can be done with the `bezier` keyword:
2022-09-24 16:03:37 +02:00
```ini
2024-07-30 21:59:15 +02:00
bezier = NAME, X0, Y0, X1, Y1
2022-09-24 15:32:40 +02:00
```
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
2024-02-20 21:16:07 +01:00
[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 ).
2022-09-24 15:32:40 +02:00
2024-02-20 21:16:07 +01:00
### Example
2022-09-24 15:32:40 +02:00
2022-09-24 16:03:37 +02:00
```ini
2024-07-30 21:59:15 +02:00
bezier = overshot, 0.05, 0.9, 0.1, 1.1
2022-09-24 15:32:40 +02:00
```
2022-10-23 16:35:39 +02:00
2024-02-20 21:16:07 +01:00
### Extras
2022-10-23 16:35:39 +02:00
For animation style `popin` in `windows` , you can specify a minimum percentage
2024-02-20 21:16:07 +01:00
to start from. For example, the following will make the animation 80% -> 100% of
the size:
2022-10-23 16:35:39 +02:00
```ini
2024-07-30 21:59:15 +02:00
animation = windows, 1, 8, default, popin 80%
2022-10-23 16:35:39 +02:00
```
2024-02-20 21:16:07 +01:00
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:
2023-08-17 22:30:43 +02:00
```ini
2024-07-30 21:59:15 +02:00
animation = workspaces, 1, 8, default, slidefade 20%
2023-08-17 22:30:43 +02:00
```
2024-03-28 02:41:40 +01:00
2024-07-30 21:59:15 +02:00
For animation style `slide` in windows and layers you can specify a forced side,
e.g.:
2024-03-28 02:41:40 +01:00
```ini
2024-07-30 21:59:15 +02:00
animation = windows, 1, 8, default, slide left
2024-03-28 02:41:40 +01:00
```
You can use `top` , `bottom` , `left` or `right` .