feat(niri): add screen recording

Change-Id: I2445a9f2a8aa5888857ff8b207557552d884eb1b
Reviewed-on: https://git.clicks.codes/c/Chimera/NixFiles/+/846
Reviewed-by: Skyler Grey <minion@clicks.codes>
Tested-by: Samuel Shuert <coded@clicks.codes>
diff --git a/modules/home/wayland/niri/default.nix b/modules/home/wayland/niri/default.nix
index 2f089be..6ef06a7 100644
--- a/modules/home/wayland/niri/default.nix
+++ b/modules/home/wayland/niri/default.nix
@@ -174,6 +174,9 @@
           "Ctrl+Print".action = actions.screenshot-screen;
           "Shift+Print".action = actions.screenshot-window;
 
+          "${mod}+Alt+R".action = actions.spawn "sh" "-c" ''([ -d Videos ] || mkdir Videos) && ${pkgs.wl-screenrec}/bin/wl-screenrec --geometry "$(${pkgs.slurp}/bin/slurp)" --filename "Videos/$(date +'%Y-%m-%d-%H-%M-%S').mp4"'';
+          "${mod}+Alt+Shift+R".action = actions.spawn "sh" "-c" "pkill wl-screenrec && cat \"$(${pkgs.coreutils}/bin/ls -t Videos/*.mp4 | ${pkgs.coreutils}/bin/head -n 1)\" | ${pkgs.wl-clipboard}/bin/wl-copy";
+
           "${mod}+Space".action = actions."switch-layout" "next";
           "${mod}+Shift+Space".action = actions."switch-layout" "prev";