From 6ef3ae8c01ac7cdf86b2aa81154f530921007030 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 19 Nov 2024 15:43:55 -0500 Subject: [PATCH] hyprland: screenrec --- modules/nixos/linux/gui/hyprland/settings.nix | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/modules/nixos/linux/gui/hyprland/settings.nix b/modules/nixos/linux/gui/hyprland/settings.nix index 3b104e6..44e4d46 100644 --- a/modules/nixos/linux/gui/hyprland/settings.nix +++ b/modules/nixos/linux/gui/hyprland/settings.nix @@ -19,8 +19,28 @@ let hyprshot --clipboard-only -m region ''; }; + screenrec = pkgs.writeShellApplication { + name = "screenrec"; + meta.description = '' + Blue-light filter screen recording script for Hyprland. Stores videos in ~/Videos. + ''; + runtimeInputs = with pkgs; [ wl-screenrec slurp ]; + text = '' + #!/bin/sh + trap 'hyprshade on ${blue-light-filter}' EXIT + # Turn off blue light filter + hyprshade off + # Grab region and start recording. + cd + FN="$HOME/Videos/screenrec-$(date +'%Y%m%d%H%M%S').mp4" + echo "Selecting and recording ($FN) ... press Ctrl+C to end recording." + wl-screenrec -g "$(slurp)" -f "$FN" + ''; + }; in { + home.packages = [ screenrec ]; # Can't bind key, because user must C-c manually to end recording. + wayland.windowManager.hyprland.settings = { "$mainMod" = "SUPER"; bind = [