diff options
Diffstat (limited to 'modules/scripts/screen-recording')
| -rw-r--r-- | modules/scripts/screen-recording/assertions.nix | 11 | ||||
| -rw-r--r-- | modules/scripts/screen-recording/completion.zsh | 4 | ||||
| -rw-r--r-- | modules/scripts/screen-recording/default.nix | 35 | ||||
| -rw-r--r-- | modules/scripts/screen-recording/script.sh | 52 |
4 files changed, 0 insertions, 102 deletions
diff --git a/modules/scripts/screen-recording/assertions.nix b/modules/scripts/screen-recording/assertions.nix deleted file mode 100644 index f858623..0000000 --- a/modules/scripts/screen-recording/assertions.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ config, ... }: -[ - { - assertion = !config.scripts.screen-recording.enable || config.media.slurp.enable; - message = "scripts.screen-recording is enabled but requires `media.slurp.enable`."; - } - { - assertion = !config.scripts.screen-recording.enable || config.media.wf-recorder.enable; - message = "scripts.screen-recording is enabled but requires `media.wf-recorder.enable`."; - } -] diff --git a/modules/scripts/screen-recording/completion.zsh b/modules/scripts/screen-recording/completion.zsh deleted file mode 100644 index 835ec43..0000000 --- a/modules/scripts/screen-recording/completion.zsh +++ /dev/null @@ -1,4 +0,0 @@ -#compdef screen-recording - -_arguments \ - '(-s --select)'{-s,--select}'[Launch slurp to select recording region]' diff --git a/modules/scripts/screen-recording/default.nix b/modules/scripts/screen-recording/default.nix deleted file mode 100644 index 6aa0f89..0000000 --- a/modules/scripts/screen-recording/default.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -let - inherit ((import ../lib.nix { inherit lib pkgs; })) mkScriptModule; - base = mkScriptModule { - name = "screen-recording"; - path = ./script.sh; - description = "Screen recording script using wf-recorder and slurp for region selection\nRecords Wayland screen to MP4\nUsage: screen-recording.sh [-s|--select]\n -s, --select Launch slurp to select recording region"; - deps = [ - pkgs.bash - config.media.slurp.package - config.media.wf-recorder.package - ]; - completion.zsh = builtins.readFile ./completion.zsh; - desktop = { - enable = true; - displayName = "Screen Recording"; - icon = "obs"; - }; - inherit config; - }; -in -{ - options = base.options; - config = base.moduleConfig // { - assertions = base.moduleConfig.assertions ++ (import ./assertions.nix { inherit config lib; }); - home.file.".local/share/icons/hicolor/scalable/apps/obs.svg" = { - source = ../../../assets/icons/obs.svg; - }; - }; -} diff --git a/modules/scripts/screen-recording/script.sh b/modules/scripts/screen-recording/script.sh deleted file mode 100644 index 336c32e..0000000 --- a/modules/scripts/screen-recording/script.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env bash -OUT_DIR="$HOME/Videos/Recordings" -mkdir -p "$OUT_DIR" - -# Colors -GREEN='\033[0;32m' -YELLOW='\033[1;33m' -RED='\033[0;31m' -NC='\033[0m' - -# Argument parsing -SELECT_MODE=false -while [[ "$#" -gt 0 ]]; do - case $1 in - -s|--select) SELECT_MODE=true ;; - esac - shift -done - -# Geometry selection -GEOMETRY="" - -if [ "$SELECT_MODE" = true ]; then - if command -v slurp >/dev/null 2>&1; then - echo -e "${YELLOW}Select a window or draw a box...${NC}" - GEOMETRY=$(slurp) - - if [ -z "$GEOMETRY" ]; then - echo "Selection cancelled. Exiting." - exit 1 - fi - else - echo -e "${RED}Error: 'slurp' not found.${NC} Recording full screen..." - sleep 1 - fi -fi - -# Start recording -FILENAME="$OUT_DIR/recording-$(date +%Y%m%d-%H%M%S).mp4" - -echo -e "${GREEN}Recording started!${NC}" -echo -e "Press ${YELLOW}'q'${NC} in this terminal to stop." -echo "File: $FILENAME" -echo "------------------------------------------------" - -if [ -n "$GEOMETRY" ]; then - wf-recorder -g "$GEOMETRY" -f "$FILENAME" -else - wf-recorder -f "$FILENAME" -fi - -echo -e "\n${GREEN}Done!${NC} Video saved to $FILENAME" |
