feat(hyprland): emit compositor config as lua
This commit is contained in:
1 parent
4908c4751f
commit
fce4bdc526
9 files changed
+346
-119
No files matched your search
@@ -7,6 +7,16 @@
|
||||
# Keyboard-driven screenshots copy to the clipboard before Satty opens for
|
||||
# annotation. Satty copies annotated screenshots when it saves them.
|
||||
let
|
||||
execBind = key: command: {
|
||||
_args = [
|
||||
key
|
||||
(luaCall "hl.dsp.exec_cmd" [ command ])
|
||||
];
|
||||
};
|
||||
luaCall =
|
||||
function: args:
|
||||
lib.generators.mkLuaInline "${function}(${lib.concatMapStringsSep ", " toLua args})";
|
||||
|
||||
user = config.user.name;
|
||||
|
||||
grimblast = "${pkgs.grimblast}/bin/grimblast";
|
||||
@@ -31,6 +41,8 @@ let
|
||||
--early-exit \
|
||||
--actions-on-enter save-to-clipboard
|
||||
'';
|
||||
|
||||
toLua = lib.generators.toLua { };
|
||||
in
|
||||
{
|
||||
options.modules.desktop.utilities.screenshot.enable =
|
||||
@@ -40,19 +52,21 @@ in
|
||||
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)$"
|
||||
wayland.windowManager.hyprland.settings.window_rule = [
|
||||
{
|
||||
name = "satty-float";
|
||||
match.class = "^(com\\.gabm\\.satty)$";
|
||||
float = true;
|
||||
}
|
||||
];
|
||||
|
||||
# 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"}"
|
||||
(execBind "Print" "${capture "area"}")
|
||||
(execBind "SHIFT + Print" "${capture "active"}")
|
||||
(execBind "CTRL + Print" "${capture "screen"}")
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user