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
@@ -6,6 +6,16 @@
|
||||
}:
|
||||
# Keybound screen recording: pick a region, then toggle a video-only capture.
|
||||
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;
|
||||
|
||||
slurp = "${pkgs.slurp}/bin/slurp";
|
||||
@@ -38,6 +48,8 @@ let
|
||||
${wf-recorder} -g "$region" -f "$file"
|
||||
${notify-send} -a "Screen recording" "Recording saved" "$file"
|
||||
'';
|
||||
|
||||
toLua = lib.generators.toLua { };
|
||||
in
|
||||
{
|
||||
options.modules.desktop.utilities.recording.enable =
|
||||
@@ -45,9 +57,8 @@ 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}"
|
||||
(execBind "SUPER + SHIFT + R" "${toggle}")
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user