Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

Resetting layouts

Open drishal opened this issue 3 years ago • 6 comments

I have a small feature request: please add an option to reset layouts to as it was by default, for eg if I use something like resizeactive, swapmaster etc, there should be a way to reset it back to how it was before, i.e reverse actions of add/remove master, resizeactive, etc

drishal avatar Nov 18 '22 18:11 drishal

Why? confusing and idiotic.

vaxerski avatar Nov 18 '22 19:11 vaxerski

Sometimes one accidentally presses the wrong keybinds and messes up the layouts, that is why I would love such a feature

drishal avatar Nov 19 '22 04:11 drishal

bind?

bind = $mainMod, L, exec, hyprctl keyword general:layout dwindle
bind = $mainMod, M, exec, hyprctl keyword general:layout master

Jedsek avatar Nov 27 '22 07:11 Jedsek

But that does not reset resizeactive back to default

drishal avatar Nov 27 '22 07:11 drishal

@drishal You could wirte script

This is a example ~/.config/hypr/scripts/toggle-layout.sh:

#!/usr/bin/env bash

CURRENT_LAYOUT=$(hyprctl getoption general:layout | sed -n '4p' | awk '{print $2}' | sed 's/\"//g')
if [[ $CURRENT_LAYOUT == dwindle ]];then
  hyprctl keyword general:layout master
elif [[ $CURRENT_LAYOUT == master ]];then
  hyprctl keyword general:layout dwindle
fi

in hyprland.conf:

$scripts = ~/.config/hypr/scripts
bind = $mainMod, Space,           exec, sh $scripts/toggle-layout.sh

and you could do more by using script :)

Jedsek avatar Dec 03 '22 09:12 Jedsek

@drishal You could wirte script

This is a example ~/.config/hypr/scripts/toggle-layout.sh:

#!/usr/bin/env bash

CURRENT_LAYOUT=$(hyprctl getoption general:layout | sed -n '4p' | awk '{print $2}' | sed 's/\"//g')
if [[ $CURRENT_LAYOUT == dwindle ]];then
  hyprctl keyword general:layout master
elif [[ $CURRENT_LAYOUT == master ]];then
  hyprctl keyword general:layout dwindle
fi

in hyprland.conf:

$scripts = ~/.config/hypr/scripts
bind = $mainMod, Space,           exec, sh $scripts/toggle-layout.sh

and you could do more by using script :)

Oh dear github for some reason did not somehow send me a mail on the ping...not sure what happened anyways, hyprctl keyword general:layout master does not exactly put resizeactive back to center, i.e where it should have been

drishal avatar Jan 26 '23 14:01 drishal