mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
tests/hyprland: add submap test
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
5f64bcccef
commit
061793150a
3 changed files with 89 additions and 0 deletions
|
|
@ -8,4 +8,5 @@ lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
|
||||||
hyprland-null-portal-package-config = ./null-portal-package-config.nix;
|
hyprland-null-portal-package-config = ./null-portal-package-config.nix;
|
||||||
hyprland-sourceFirst-false-config = ./sourceFirst-false-config.nix;
|
hyprland-sourceFirst-false-config = ./sourceFirst-false-config.nix;
|
||||||
hyprland-inconsistent-config = ./inconsistent-config.nix;
|
hyprland-inconsistent-config = ./inconsistent-config.nix;
|
||||||
|
hyprland-submaps-config = ./submaps-config.nix;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
28
tests/modules/services/hyprland/submaps-config.conf
Normal file
28
tests/modules/services/hyprland/submaps-config.conf
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
exec-once = @dbus@/bin/dbus-update-activation-environment --systemd DISPLAY HYPRLAND_INSTANCE_SIGNATURE WAYLAND_DISPLAY XDG_CURRENT_DESKTOP && systemctl --user stop hyprland-session.target && systemctl --user start hyprland-session.target
|
||||||
|
$mod=SUPER
|
||||||
|
bind=$mod, S, submap, resize
|
||||||
|
bind=$mod, M, submap, move_focus
|
||||||
|
submap = move_focus
|
||||||
|
bind=, h, movefocus, l
|
||||||
|
bind=, j, movefocus, d
|
||||||
|
bind=, k, movefocus, u
|
||||||
|
bind=, l, movefocus, r
|
||||||
|
bind=, left, movefocus, l
|
||||||
|
bind=, down, movefocus, d
|
||||||
|
bind=, up, movefocus, u
|
||||||
|
bind=, right, movefocus, r
|
||||||
|
bind=, escape, submap, reset
|
||||||
|
submap = reset
|
||||||
|
|
||||||
|
submap = resize
|
||||||
|
bind=, escape, submap, reset
|
||||||
|
bind=, return, submap, reset
|
||||||
|
binde=, right, resizeactive, 10 0
|
||||||
|
binde=, left, resizeactive, -10 0
|
||||||
|
binde=, up, resizeactive, 0 -10
|
||||||
|
binde=, down, resizeactive, 0 10
|
||||||
|
binde=, l, resizeactive, 10 0
|
||||||
|
binde=, h, resizeactive, -10 0
|
||||||
|
binde=, k, resizeactive, 0 -10
|
||||||
|
binde=, j, resizeactive, 0 10
|
||||||
|
submap = reset
|
||||||
60
tests/modules/services/hyprland/submaps-config.nix
Normal file
60
tests/modules/services/hyprland/submaps-config.nix
Normal file
|
|
@ -0,0 +1,60 @@
|
||||||
|
{ config, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
wayland.windowManager.hyprland = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
"$mod" = "SUPER";
|
||||||
|
|
||||||
|
bind = [
|
||||||
|
"$mod, S, submap, resize"
|
||||||
|
"$mod, M, submap, move_focus"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
submaps = {
|
||||||
|
resize = {
|
||||||
|
settings = {
|
||||||
|
binde = [
|
||||||
|
", right, resizeactive, 10 0"
|
||||||
|
", left, resizeactive, -10 0"
|
||||||
|
", up, resizeactive, 0 -10"
|
||||||
|
", down, resizeactive, 0 10"
|
||||||
|
", l, resizeactive, 10 0"
|
||||||
|
", h, resizeactive, -10 0"
|
||||||
|
", k, resizeactive, 0 -10"
|
||||||
|
", j, resizeactive, 0 10"
|
||||||
|
];
|
||||||
|
|
||||||
|
bind = [
|
||||||
|
", escape, submap, reset"
|
||||||
|
", return, submap, reset"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
move_focus = {
|
||||||
|
settings = {
|
||||||
|
bind = [
|
||||||
|
", h, movefocus, l"
|
||||||
|
", j, movefocus, d"
|
||||||
|
", k, movefocus, u"
|
||||||
|
", l, movefocus, r"
|
||||||
|
", left, movefocus, l"
|
||||||
|
", down, movefocus, d"
|
||||||
|
", up, movefocus, u"
|
||||||
|
", right, movefocus, r"
|
||||||
|
", escape, submap, reset"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
config=home-files/.config/hypr/hyprland.conf
|
||||||
|
assertFileExists "$config"
|
||||||
|
|
||||||
|
normalizedConfig=$(normalizeStorePaths "$config")
|
||||||
|
assertFileContent "$normalizedConfig" ${./submaps-config.conf}
|
||||||
|
'';
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue