Donate to support Palestine

How to reset the Master layout on Hyprland

Yusef Aslam - 28 Oct 2025

linux
wm
hyprland
twm
tiling-wm
Tutorial

Since Hyprland does not come with a way to reset the Master layout like X11 window managers such as XMonad, this has to be done manually using hyprctl:

#!/bin/bash
# Reset the master layout on Hyprland.
# Hyprland does not come with a way to reset the layout
# like XMonad and some other window managers do.
# So we have to do it manually.
#
# Author: Yusef Aslam

# Reset the master/stack factor and orientation
hyprctl dispatch layoutmsg mfact -1.0
hyprctl dispatch layoutmsg mfact +0.45
hyprctl dispatch layoutmsg orientationleft

# Move windows out of fullscreen
hyprctl dispatch fullscreenstate 0

This script:

  • Reset the master / slave layout factor
  • Sets the orientation back to left (the default in my configuration)
  • Disables fullscreen mode for the active window

In order to get a behaviour similar to XMonad, this script can be bound to a key:

# reset the master layout
bind = $mainMod_SHIFT, SPACE, exec, ~/bin/hypr-resetlayout.sh