z_mirror/dotfiles
git clone https://git.raiguard.me/z_mirror/dotfiles
b3386d4
uraya-alpine
1#!/bin/sh 2 3set -e 4 5getTargetDirectory() { 6 test -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs && \ 7 . ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs 8 9 echo "${XDG_VIDEOS_DIR:-~/pictures}/screencasts" 10} 11 12FILE=${3:-$(getTargetDirectory)/$(date -Is).mp4} 13while getopts 'r:so:w' c; do 14 case $c in 15 r) GEOM="$OPTARG" ;; 16 s) GEOM=$(slurp -o) ;; 17 o) FILE="$OPTARG" ;; 18 w) GEOM=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp) ;; 19 esac 20done 21shift $((OPTIND-1)) 22 23if [ -z "$GEOM" ]; then 24 GEOM=$(slurp) 25fi 26 27if [ -z "$GEOM" ]; then 28 exit 29fi 30 31wf-recorder -c libx264 -x yuv420p -g "$GEOM" -f "$FILE" "$@"