Hyprland out of the box does not come with a way to reset the master layout like X11 window managers such as XMonad. In this post I will show you how to write a bind that resets the layout master/slave factor on Hyprland.

In your ~/.config/hypr/hyprland.conf, add this bind which will run the hypr-resetlayout.sh script:

bind = $mainMod_SHIFT, SPACE, exec, hypr-resetlayout.sh

Then, create a script named hypr-resetlayout.sh

#!/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

This script resets the Master layout factor and switches the orientation of the layout back to the left.

I hope this helped you, thanks for reading!