Hyprland

Hyprlandopen in new window is a dynamic wayland compositor which provides autotiling and beautiful animations out of the box.

Environment variables

This part will be very short, but I first need to set some environment variables.

env = XCURSOR_SIZE,24
env = SDL_VIDEODRIVER,wayland

Hardware configuration

The first configuration I want to set is my keyboard and touchpad configuration. My keyboard uses the AFNOR standard for the bépoopen in new window layout, and I do not use the caps lock key which is replaced by the control key.

input {
    kb_layout = fr
    kb_variant = bepo_afnor
    kb_model =
    kb_options = caps:ctrl_modifier
    kb_rules =

    follow_mouse = 1

    touchpad {
        natural_scroll = false
    }

    sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
}

We can then set the monitors used. If HDMI-A-1 is not found when Hyprland launches, it will simply ignore it. And at worst, I can use wdisplaysopen in new window to manually set the position of my screens.

Monitor nameResolutionRefresh rate (Hz)Position
HDMI-A-12560x10800x0
eDP-11920x10801202560x0

This translates into the following configuration:

monitor = HDMI-A-1, 2560x1080, 0x0, 1
monitor = eDP-1, 1920x1080@120, 2560x0, 1

Visual configuration

Now, onto the visual configuration. I like my gaps, and I feel keeping my windows relatively tight together but with a greater gap around them looks nice. I also like the Nord palette which I use here for my window border colours. Active windows get a gradient from nord9 to nord14, while inactive windows get a nord3 border. Lastly, I use the dwindle layout as I find it nicer to use than the master layout.

general {
    gaps_in = 5
    gaps_out = 20
    border_size = 2
    col.active_border = rgb(81a1c1) rgb(a3be8c) 45deg
    col.inactive_border = rgb(4c566a)
    layout = dwindle
}

I may one day use the layout_centeropen in new window layout from pyprlandopen in new window, but I haven’t got around to do that yet.

This section is specific to touchpads, but I like to use it to switch between workspaces quickly. Note that I only want to swipe between existing workspaces, not to create new ones.

gestures {
    workspace_swipe = true
    workspace_swipe_numbered = true
}

Decorations are just a nice thing to make things look pretty. I like some slight rounding on my windows with a nice though light shadow. Again, the colour comes from the Nord palette with nord0.

decoration {
    rounding = 5
    blur {
        enabled = true
        size = 9
        passes = 1
    }
    drop_shadow = true
    shadow_range = 4
    shadow_render_power = 3
    col.shadow = rgba(2e3440aa)
}

Animations are fun! I mostly kept the default animations from the example config of Hyprland.

animations {
    enabled = true
    bezier = myBezier, 0.05, 0.9, 0.1, 1.05
    animation = windows, 1, 7, myBezier
    animation = windowsOut, 1, 7, default, popin 80%
    animation = border, 1, 10, default
    animation = borderangle, 1, 8, default
    animation = fade, 1, 7, default
    animation = workspaces, 1, 6, default
}

Now, we can take care of the configuration of the layouts. The only notable thing here is that I prefer to have no gaps when there is only one window in the dwindle layout. Not much is done with the master layout, as I don’t use it.

dwindle {
    pseudotile = true
    preserve_split = true
    no_gaps_when_only = 1
}

master {
    new_is_master = true
}

Autolaunch of programs

The exec-once directive of Hyprland allows the user to launch the associated command only when Hyprland starts in order to avoid launching multiple instances of some programs.

First, I’ll import some environment variables into Hyprland. These may be necessary for some programs.

exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=Hyprland

Next, I’ll launch some programs that will give Hyprland a nice appearance: waybaropen in new window and wpaperdopen in new window.

exec-once = wpaperd
exec-once = waybar

Let’s also take care of some sound stuff. If any new input or output is detected, switch to it. And stop the music, just in case.

exec-once = pactl load-module module-switch-on-connect
exec-once = mpc stop

Having a working policy kit is generally a good idea.

exec-once = xfce-polkit

Now, let’s launch the notification daemon swayncopen in new window.

exec-once = swaync

Let’s also launch wlsunsetopen in new window. I’ll very vagely aim at Paris with the longitude and latitude.

exec-once = wlsunset -l 48.5 -L 2.2 -d 1500

Let’s launch some apps and their applet. Here, we’re launching the applets for NetworkManager, KDE Connect, and blueman (the bluetooth manager).

exec-once = nm-applet
exec-once = /usr/lib/kdeconnectd
exec-once = kdeconnect-indicator
exec-once = blueman-applet

Finally, let’s launch swayidleopen in new window which lets us lock our session. It’ll automatically pause any media playing.

exec-once = swayidle -w timeout 600 'plock' before-sleep 'playerctl pause; plock' lock 'plock'

Keybindings

First, let me make a couple of variables for reusability. Mind you, hjkl becomes ctsr in the bépo keyboard layout.

$left = c
$right = r
$up = s
$down = t
$menu = rofi -combi-modi drun -show combi

Now, I’d like to introduce a concept which I really enjoy: submaps. They allow the Hyprland user to make keychords similar to Emacs, which allows us to unlock the full potential of keybindings in a window manager. In Hyprland, something to be wary of is that there is no automatic submap switching. If there is no explicit indication to exit the current submap or to switch to another submap, Hyprland will just stay on the current submap. So, using something like bind = CTRL, g, submap, reset is necessary to exit the current submap on C-g (or Control + g, I like the Emacs notation).

In the submap tables below, the submap column may indicate reset, a submap’s name, or nothing. If nothing is indicated, the key will not act on the current submap or switch to another one. A submap’s name will make the key switch to said submap, while the value reset will make us go back to the root submap. Note that all submaps will also have the escape and C-g keys mapped to exiting the current submap.

Note also that I sometimes use bind flagsopen in new window. I’ll only set the flag in the appropriate column when necessary.

These are the keybindings that are present on the top-level keybinding map.

ModifiersKeyActionArgumentSubmap
SUPERReturnexeckitty
SUPERSpaceleader
Printscreenshot
bind = SUPER, Return, exec, kitty
bind = SUPER, Space, submap, leader
bind = , Print, submap, screenshot

submap = leader
bind = , l, exec, plock
bind = , l, submap, reset
bind = , a, submap, apps
bind = , b, submap, buffers
bind = , w, submap, windows
bind = , escape, submap, reset
bind = CTRL, g, submap, reset

submap = apps
bind = , b, exec, firefox
bind = , b, submap, reset
bind = SHIFT, b, exec, qutebrowser
bind = SHIFT, b, submap, reset
bind = , d, exec, discord
bind = , d, submap, reset
bind = , e, exec, emacsclient -c -n
bind = , e, submap, reset
bind = , g, exec, gimp
bind = , g, submap, reset
bind = , n, exec, nemo
bind = , n, submap, reset
bind = , r, submap, rofi
bind = , u, exec, $menu
bind = , u, submap, reset
bind = , escape, submap, reset
bind = CTRL, g, submap, reset
submap = buffers
bind = , d, killactive, 
bind = , d, submap, reset
bind = , escape, submap, reset
bind = CTRL, g, submap, reset
submap = resize
binde = , $left, resizeactive, -10 0
binde = , $right, resizeactive, 10 0
binde = , $up, resizeactive, 0 -10
binde = , $down, resizeactive, 0 10
bind = , q, submap, reset
bind = , escape, submap, reset
bind = CTRL, g, submap, reset
submap = rofi
bind = , a, exec, awiki
bind = , a, submap, reset
bind = , b, exec, bluetooth-connect
bind = , b, submap, reset
bind = , e, exec, rofi-emoji
bind = , e, submap, reset
bind = , r, exec, $menu
bind = , r, submap, reset
bind = , s, exec, rofi -show ssh
bind = , s, submap, reset
bind = , y, exec, ytplay
bind = , y, submap, reset
bind = SHIFT, y, exec, rofi-ytdl
bind = SHIFT, y, submap, reset
bind = , escape, submap, reset
bind = CTRL, g, submap, reset
submap = screenshot
bind = , Print, exec, screenshot
bind = , Print, submap, reset
bind = , d, exec, screenshot -d 3
bind = , d, submap, reset
bind = Shift, d, exec, screenshot -sced 3
bind = Shift, d, submap, reset
bind = , e, exec, screenshot -sec
bind = , e, submap, reset
bind = , s, exec, screenshot -s
bind = , s, submap, reset
bind = Shift, s, exec, screenshot -sc
bind = Shift, s, submap, reset
bind = , escape, submap, reset
bind = CTRL, g, submap, reset
submap = windows
bind = , period, submap, resize
bind = , $left, movefocus, l
bind = , $left, submap, reset
bind = , $right, movefocus, r
bind = , $right, submap, reset
bind = , $up, movefocus, u
bind = , $up, submap, reset
bind = , $down, movefocus, d
bind = , $down, submap, reset
bind = SHIFT, $left, movewindow, l
bind = SHIFT, $left, submap, reset
bind = SHIFT, $right, movewindow, r
bind = SHIFT, $right, submap, reset
bind = SHIFT, $up, movewindow, u
bind = SHIFT, $up, submap, reset
bind = SHIFT, $down, movewindow, d
bind = SHIFT, $down, submap, reset
bind = CTRL_SHIFT, $left, moveworkspacetomonitor, e+0 +1
bind = CTRL_SHIFT, $left, submap, reset
bind = CTRL_SHIFT, $right, moveworkspacetomonitor, e+0 -1
bind = CTRL_SHIFT, $right, submap, reset
bind = , d, killactive, 
bind = , d, submap, reset
bind = , f, fullscreen, 
bind = , f, submap, reset
bind = SHIFT, f, togglefloating, 
bind = SHIFT, f, submap, reset
bind = , escape, submap, reset
bind = CTRL, g, submap, reset

submap = reset
bindl = , XF86AudioPlay, exec, playerctl play-pause
bindl = , XF86AudioPause, exec, playerctl pause
bindl = , XF86AudioStop, exec, playerctl stop
bindl = , XF86AudioPrev, exec, playerctl previous
bindl = , XF86AudioNext, exec, playerctl next
bindl = , XF86AudioForward, exec, playerctl position +1
bindl = , XF86AudioRewind, exec, playerctl position -1
bindl = , XF86AudioRaiseVolume, exec, pamixer -i 2
bindl = , XF86AudioLowerVolume, exec, pamixer -d 2
bindl = , XF86MonBrightnessUp, exec, xbacklight -perceived -inc 2
bindl = , XF86MonBrightnessDown, exec, xbacklight -perceived -dec 2
bindl = , XF86KbdBrightnessUp, exec, xbacklight -perceived -inc 2
bindl = , XF86KbdBrightnessDown, exec, xbacklight -perceived -dec 2
bind = SUPER, $left, movefocus, l
bind = SUPER, $right, movefocus, r
bind = SUPER, $up, movefocus, u
bind = SUPER, $down, movefocus, d
bind = SUPER_SHIFT, $left, movewindow, l
bind = SUPER_SHIFT, $left, submap, reset
bind = SUPER_SHIFT, $right, movewindow, r
bind = SUPER_SHIFT, $right, submap, reset
bind = SUPER_SHIFT, $up, movewindow, u
bind = SUPER_SHIFT, $up, submap, reset
bind = SUPER_SHIFT, $down, movewindow, d
bind = SUPER_SHIFT, $down, submap, reset
bind = SUPER_CTRL_SHIFT, $left, moveworkspacetomonitor, e+0 +1
bind = SUPER_CTRL_SHIFT, $left, submap, reset
bind = SUPER_CTRL_SHIFT, $right, moveworkspacetomonitor, e+0 -1
bind = SUPER_CTRL_SHIFT, $right, submap, reset
bind = SUPER, Tab, cyclenext, 
bind = SUPER_SHIFT, Tab, cyclenext, prev
bindm = SUPER, mouse:272, movewindow
bindm = SUPER, mouse:273, resizewindow
bind = SUPER, quotedbl, workspace, 1
bind = SUPER, guillemotleft, workspace, 2
bind = SUPER, guillemotright, workspace, 3
bind = SUPER, parenleft, workspace, 4
bind = SUPER, parenright, workspace, 5
bind = SUPER, at, workspace, 6
bind = SUPER, plus, workspace, 7
bind = SUPER, minus, workspace, 8
bind = SUPER, slash, workspace, 9
bind = SUPER, asterisk, workspace, 10
bind = SUPER, mouse_down, workspace, e+1
bind = SUPER, mouse_up, workspace, e-1
bind = SUPER_SHIFT, quotedbl, movetoworkspace, 1
bind = SUPER_SHIFT, guillemotleft, movetoworkspace, 2
bind = SUPER_SHIFT, guillemotright, movetoworkspace, 3
bind = SUPER_SHIFT, parenleft, movetoworkspace, 4
bind = SUPER_SHIFT, parenright, movetoworkspace, 5
bind = SUPER_SHIFT, at, movetoworkspace, 6
bind = SUPER_SHIFT, plus, movetoworkspace, 7
bind = SUPER_SHIFT, minus, movetoworkspace, 8
bind = SUPER_SHIFT, slash, movetoworkspace, 9
bind = SUPER_SHIFT, asterisk, movetoworkspace, 10

Top keybindings

Media keys

ModifiersKeyActionArgumentSubmapBind flag
XF86AudioPlayexecplayerctl play-pausel
XF86AudioPauseexecplayerctl pausel
XF86AudioStopexecplayerctl stopl
XF86AudioPrevexecplayerctl previousl
XF86AudioNextexecplayerctl nextl
XF86AudioForwardexecplayerctl position +1l
XF86AudioRewindexecplayerctl position -1l
XF86AudioRaiseVolumeexecpamixer -i 2l
XF86AudioLowerVolumeexecpamixer -d 2l
XF86MonBrightnessUpexecxbacklight -perceived -inc 2l
XF86MonBrightnessDownexecxbacklight -perceived -dec 2l
XF86KbdBrightnessUpexecxbacklight -perceived -inc 2l
XF86KbdBrightnessDownexecxbacklight -perceived -dec 2l

Quick window movements and actions

These are basically a rehash of what you can find in the windows submap but with a few missing keybindings and other extras.

ModifiersKeyActionArgumentSubmap
SUPER$leftmovefocusl
SUPER$rightmovefocusr
SUPER$upmovefocusu
SUPER$downmovefocusd
SUPER_SHIFT$leftmovewindowlreset
SUPER_SHIFT$rightmovewindowrreset
SUPER_SHIFT$upmovewindowureset
SUPER_SHIFT$downmovewindowdreset
SUPER_CTRL_SHIFT$leftmoveworkspacetomonitore+0 +1reset
SUPER_CTRL_SHIFT$rightmoveworkspacetomonitore+0 -1reset
SUPERTabcyclenext
SUPER_SHIFTTabcyclenextprev

Something I really appreciate with window managers in Linux is the able to really easily move and resize windows. The keybinds below allow the user to press down the super key and perform an action on the window:

  • with a left click, move the window around
  • with a right click, resize the window
ModifiersKeyAction
SUPERmouse:272movewindow
SUPERmouse:273resizewindow

Workspace movements

Due to the bépo layout, the number row does not give immediate access to numbers, but to punctuation symbols. You can find below a table of equivalence of the characters’ name and the actual character, as well as the number that sits on the same key when pressing shift.

Character nameCharacterNumber
quotedbl"1
guillemotleft«2
guillemotright»3
parenleft(4
parenright)5
at@6
plus+7
minus-8
slash/9
asterisk*0
ModifiersKeyActionArgument
SUPERquotedblworkspace1
SUPERguillemotleftworkspace2
SUPERguillemotrightworkspace3
SUPERparenleftworkspace4
SUPERparenrightworkspace5
SUPERatworkspace6
SUPERplusworkspace7
SUPERminusworkspace8
SUPERslashworkspace9
SUPERasteriskworkspace10
SUPERmouse_downworkspacee+1
SUPERmouse_upworkspacee-1
SUPER_SHIFTquotedblmovetoworkspace1
SUPER_SHIFTguillemotleftmovetoworkspace2
SUPER_SHIFTguillemotrightmovetoworkspace3
SUPER_SHIFTparenleftmovetoworkspace4
SUPER_SHIFTparenrightmovetoworkspace5
SUPER_SHIFTatmovetoworkspace6
SUPER_SHIFTplusmovetoworkspace7
SUPER_SHIFTminusmovetoworkspace8
SUPER_SHIFTslashmovetoworkspace9
SUPER_SHIFTasteriskmovetoworkspace10

Leader

The leader submap is accessible by pressing s-SPC (Super and space). It is sort of the general menu for my keybindings.

ModifiersKeyActionArgumentSubmap
lexecplockreset
aapps
bbuffers
wwindows

Apps

ModifiersKeyActionArgumentSubmap
bexecfirefoxreset
SHIFTbexecqutebrowserreset
dexecdiscordreset
eexecemacsclient -c -nreset
gexecgimpreset
nexecnemoreset
rrofi
uexec$menureset

Buffers

I call this the buffer window, but it’s mostly due to my habit of handling Emacs buffers. Some of my muscle memory may never fade away. Consider this as an addition to the windows submap.

ModifiersKeyActionArgumentSubmap
dkillactivereset

Resize

This is an example of a submap where I may not want to immediately exit it. We enter it with the keychord s-SPC w . and exit it with either the usual C-g, escape key, but also with the q key.

ModifiersKeyActionArgumentSubmapBind flag
$leftresizeactive-10 0e
$rightresizeactive10 0e
$upresizeactive0 -10e
$downresizeactive0 10e
qreset

Rofi

This submap hosts quite a few menus handled with rofiopen in new window (I use this wayland forkopen in new window). You may want to take a look at custom scripts to know what most of these do.

ModifiersKeyActionArgumentSubmap
aexecawikireset
bexecbluetooth-connectreset
eexecrofi-emojireset
rexec$menureset
sexecrofi -show sshreset
yexecytplayreset
SHIFTyexecrofi-ytdlreset

Screenshots

Here are the keybinding for the screenshot submap

ModifiersKeyActionArgumentSubmap
Printexecscreenshotreset
dexecscreenshot -d 3reset
Shiftdexecscreenshot -sced 3reset
eexecscreenshot -secreset
sexecscreenshot -sreset
Shiftsexecscreenshot -screset

Windows

ModifiersKeyActionArgumentSubmap
periodresize
$leftmovefocuslreset
$rightmovefocusrreset
$upmovefocusureset
$downmovefocusdreset
SHIFT$leftmovewindowlreset
SHIFT$rightmovewindowrreset
SHIFT$upmovewindowureset
SHIFT$downmovewindowdreset
CTRL_SHIFT$leftmoveworkspacetomonitore+0 +1reset
CTRL_SHIFT$rightmoveworkspacetomonitore+0 -1reset
dkillactivereset
ffullscreenreset
SHIFTftogglefloatingreset

Window rules

For now, I don’t have a lot of window rules. One, actually. It makes the XFCE polkit a floating window.

windowrulev2 = float,class:^(xfce-polkit)$