refactor(nixos): migrate Hyprland to Lua
This commit is contained in:
@@ -39,9 +39,13 @@ in
|
||||
# session so uwsm starts and stops them with it.
|
||||
services.cliphist.enable = true;
|
||||
|
||||
# $mod is defined by the compositor config these binds share.
|
||||
wayland.windowManager.hyprland.settings.bind = [
|
||||
"$mod SHIFT, V, exec, ${picker}"
|
||||
{
|
||||
_args = [
|
||||
(lib.generators.mkLuaInline ''mod .. " + SHIFT + V"'')
|
||||
(lib.generators.mkLuaInline "hl.dsp.exec_cmd(${builtins.toJSON picker})")
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -45,9 +45,13 @@ in
|
||||
|
||||
config = lib.mkIf config.modules.desktop.utilities.recording.enable {
|
||||
home-manager.users.${user} = {
|
||||
# $mod is defined by the compositor config these binds share.
|
||||
wayland.windowManager.hyprland.settings.bind = [
|
||||
"$mod SHIFT, R, exec, ${toggle}"
|
||||
{
|
||||
_args = [
|
||||
(lib.generators.mkLuaInline ''mod .. " + SHIFT + R"'')
|
||||
(lib.generators.mkLuaInline "hl.dsp.exec_cmd(${builtins.toJSON toggle})")
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -38,21 +38,34 @@ in
|
||||
|
||||
config = lib.mkIf config.modules.desktop.utilities.screenshot.enable {
|
||||
home-manager.users.${user} = {
|
||||
# satty is a one-shot annotation surface, so float it rather than letting
|
||||
# it claim a tile in the layout.
|
||||
# windowrule v3 syntax: space-separated field/value tokens, comma
|
||||
# separated, with matchers under a match: prefix and effects bare.
|
||||
wayland.windowManager.hyprland.settings.windowrule = [
|
||||
"float 1, match:class ^(com\\.gabm\\.satty)$"
|
||||
];
|
||||
# Satty is a one-shot annotation surface, so it floats above the layout.
|
||||
wayland.windowManager.hyprland.settings.window_rule = {
|
||||
float = true;
|
||||
match.class = "^(com\\.gabm\\.satty)$";
|
||||
};
|
||||
|
||||
# Print with plain/Shift/Ctrl for region/window/full.
|
||||
# Super+L is already the hjkl focus and movement bind, so screenshots take
|
||||
# the Print key instead.
|
||||
wayland.windowManager.hyprland.settings.bind = [
|
||||
", Print, exec, ${capture "area"}"
|
||||
"SHIFT, Print, exec, ${capture "active"}"
|
||||
"CTRL, Print, exec, ${capture "screen"}"
|
||||
{
|
||||
_args = [
|
||||
"PRINT"
|
||||
(lib.generators.mkLuaInline "hl.dsp.exec_cmd(${builtins.toJSON (capture "area")})")
|
||||
];
|
||||
}
|
||||
{
|
||||
_args = [
|
||||
"SHIFT + PRINT"
|
||||
(lib.generators.mkLuaInline "hl.dsp.exec_cmd(${builtins.toJSON (capture "active")})")
|
||||
];
|
||||
}
|
||||
{
|
||||
_args = [
|
||||
"CTRL + PRINT"
|
||||
(lib.generators.mkLuaInline "hl.dsp.exec_cmd(${builtins.toJSON (capture "screen")})")
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user