2024-02-20 21:16:07 +01:00
---
weight: 17
title: Uncommon tips & tricks
---
2022-08-12 20:46:36 +02:00
2024-02-20 21:16:07 +01:00
## Switchable keyboard layouts
The easiest way to accomplish this is to set this using XKB settings, for
example:
2022-10-23 16:38:28 +02:00
2022-10-17 14:52:17 +02:00
```
input {
2024-03-28 03:08:52 +01:00
kb_layout = us,cz
kb_variant = ,qwerty
2022-10-17 14:52:17 +02:00
kb_options = grp:alt_shift_toggle
}
2022-08-12 20:46:36 +02:00
```
2022-08-20 19:09:47 +02:00
2024-03-28 03:08:52 +01:00
Variants are set per layout.
2024-02-20 21:16:07 +01:00
{{< callout > }}
2022-08-20 19:03:43 +02:00
2024-03-31 13:42:20 +02:00
The first layout defined in the input section will be the one used for binds by
default.
2022-08-20 19:03:43 +02:00
2024-02-20 21:16:07 +01:00
For example: `us,ua` -> config binds would be e.g. `SUPER, A` , while on `ua,us`
-> `SUPER, Cyrillic_ef`
2022-08-20 19:03:43 +02:00
2024-03-31 13:42:20 +02:00
You can change this behavior globally or per-device by setting
`resolve_binds_by_sym = 1` . In that case, binds will activate when the symbol
typed matches the symbol specified in the bind.
2024-02-28 00:21:25 +01:00
2024-03-31 13:42:20 +02:00
For example: if your layouts are `us,fr` and have a bind for `SUPER, A` you'd
need to press the first letter on the second row while the `us` layout is active
and the first letter on the first row while the `fr` layout is active.
2024-02-28 00:21:25 +01:00
2024-02-20 21:16:07 +01:00
{{< / callout > }}
2022-08-20 19:03:43 +02:00
2024-02-20 21:16:07 +01:00
You can also bind a key to execute `hyprctl switchxkblayout` for more keybind
2024-03-17 13:44:39 +01:00
freedom. See [Using hyprctl ](../Using-hyprctl ).
2022-12-03 16:59:13 +01:00
2024-02-20 21:16:07 +01:00
To find the valid layouts and `kb_options` , you can check out the
`/usr/share/X11/xkb/rules/base.lst` . For example:
2023-04-12 21:14:24 +02:00
To get the layout name of a language:
2024-02-20 21:16:07 +01:00
2023-04-12 21:14:24 +02:00
```sh
grep -i 'persian' /usr/share/X11/xkb/rules/base.lst
```
2024-02-20 21:16:07 +01:00
To get the list of keyboard shortcuts you can put in the `kb_options` to toggle
keyboard layouts:
2023-04-12 21:14:24 +02:00
```sh
grep 'grp:.*toggle' /usr/share/X11/xkb/rules/base.lst
```
2024-02-20 21:16:07 +01:00
## Disabling keybinds with one master keybind
2022-08-12 20:46:36 +02:00
2023-01-11 16:55:15 +01:00
If you want to disable all keybinds with another keybind (make a keybind toggle
2022-08-13 01:47:48 +02:00
of sorts) you can just use a submap with only a keybind to exit it.
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
bind=MOD,KEY,submap,clean
submap=clean
bind=MOD,KEY,submap,reset
submap=reset
2022-08-13 01:47:48 +02:00
```
2024-02-20 21:16:07 +01:00
## Remap Caps-Lock to Ctrl
2023-03-20 17:06:18 +01:00
```
input {
kb_options = ctrl:nocaps
}
```
2022-10-21 02:06:33 +02:00
2024-02-20 21:16:07 +01:00
## Swap Caps-Lock and Escape
2024-02-07 17:25:25 +01:00
```
input {
kb_options = caps:swapescape
}
```
2024-02-20 21:16:07 +01:00
## Minimize Steam instead of killing
2023-01-14 20:29:38 +01:00
2024-02-20 21:16:07 +01:00
Steam will exit entirely when it's last window is closed using the `killactive`
dispatcher. To minimize Steam to tray, use the following script to close
applications:
2023-01-14 20:29:38 +01:00
```sh
2023-04-23 22:20:55 +02:00
if [ "$(hyprctl activewindow -j | jq -r ".class")" = "Steam" ]; then
xdotool getactivewindow windowunmap
2023-01-14 20:29:38 +01:00
else
hyprctl dispatch killactive ""
fi
```
2024-02-20 21:16:07 +01:00
## Window Dancing
2022-10-21 02:06:33 +02:00
2024-02-20 21:16:07 +01:00
Some XWayland games like Rhythm Doctor and Friday Night Funkin' mods like to
move the windows by themselves, but that often doesn't work by default.
2022-10-21 02:06:33 +02:00
2022-10-23 16:38:28 +02:00
For example, if you want to configure Rhythm Doctor, you'd have to:
2022-10-21 02:06:33 +02:00
1. Set input rules
2024-02-20 21:16:07 +01:00
2022-10-21 02:06:33 +02:00
```ini
input {
# ...
follow_mouse=0
float_switch_override_focus=0
}
```
2. Set the windowrule
```ini
2022-10-27 22:34:17 +02:00
windowrule=windowdance,title:^(Rhythm Doctor)$
# windowrule=forceinput,title:^(Rhythm Doctor)$ # May also be needed
2022-10-21 02:06:33 +02:00
```
3. Have fun!
2022-10-21 04:32:36 +02:00
Click the GIF below to see a full demo video
2022-10-21 02:06:33 +02:00
2024-03-31 13:42:20 +02:00
[![Demo GIF of Rhythm Doctor ](https://pool.jortage.com/voringme/misskey/565b9dfb-125f-4ea0-9257-b371cb4c7195.mp4 )](https://pool.jortage.com/voringme/misskey/565b9dfb-125f-4ea0-9257-b371cb4c7195.mp4)
2022-10-21 04:43:44 +02:00
2024-02-20 21:16:07 +01:00
### Shimeji
2022-10-21 04:43:44 +02:00
2024-02-20 21:16:07 +01:00
To use Shimeji programs like
[this ](https://codeberg.org/thatonecalculator/spamton-linux-shimeji ), set the
following rules:
2022-10-21 04:43:44 +02:00
```ini
windowrule=float, com-group_finity-mascot-Main
windowrule=noblur, com-group_finity-mascot-Main
windowrule=nofocus, com-group_finity-mascot-Main
windowrule=noshadow, com-group_finity-mascot-Main
windowrule=noborder, com-group_finity-mascot-Main
```
2024-02-20 21:16:07 +01:00
{{< callout type = info > }}
2022-10-21 04:43:44 +02:00
2024-02-20 21:16:07 +01:00
The app indicator probably won't show, so you'll have to `killall -9 java` to
kill them.
2022-10-21 04:43:44 +02:00
2024-02-20 21:16:07 +01:00
{{< / callout > }}
2022-10-21 04:43:44 +02:00
2024-03-31 13:42:20 +02:00
![Demo GIF of Spamton Shimeji ](https://github.com/hyprwm/hyprland-wiki/assets/36706276/261afd03-bf41-4513-b72b-3483d43d418c )
2023-03-13 21:49:18 +01:00
2024-02-20 21:16:07 +01:00
## Toggle animations/blur/etc hotkey
2023-03-13 21:49:18 +01:00
For increased performance in games, or for less distractions at a keypress
2024-02-20 21:16:07 +01:00
1. create file
`~/.config/hypr/gamemode.sh && chmod +x ~/.config/hypr/gamemode.sh` and add:
2023-03-13 21:49:18 +01:00
```bash
#!/usr/bin/env sh
2024-02-19 14:55:43 +01:00
HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}')
2023-04-23 22:20:55 +02:00
if [ "$HYPRGAMEMODE" = 1 ] ; then
2023-03-13 21:49:18 +01:00
hyprctl --batch "\
keyword animations:enabled 0;\
keyword decoration:drop_shadow 0;\
2023-08-06 10:50:16 +02:00
keyword decoration:blur:enabled 0;\
2023-03-13 21:49:18 +01:00
keyword general:gaps_in 0;\
keyword general:gaps_out 0;\
keyword general:border_size 1;\
keyword decoration:rounding 0"
exit
fi
hyprctl reload
```
2024-02-20 21:16:07 +01:00
Edit to your liking of course. If animations are enabled, it disables all the
pretty stuff. Otherwise, the script reloads your config to grab your defaults.
2023-03-13 21:49:18 +01:00
2. Add this to your `hyprland.conf` :
```ini
bind = WIN, F1, exec, ~/.config/hypr/gamemode.sh
```
The hotkey toggle will be WIN+F1, but you can change this to whatever you want.