summaryrefslogtreecommitdiff
path: root/home/xyz/.local/bin/shufwall
blob: 5b249e12dfc16946e4e479c86eec7d30bd82fa9d (plain)
1
2
3
4
5
6
7
8
9
#!/bin/sh

if [ -z "$1" ]; then
	file=$(find -L "$XDG_PICTURES_DIR/wallpapers" -type f | shuf -n 1)
else
	file=$(find -L "$@" -maxdepth 1 -type f | shuf -n 1)
fi

display -resize "${SCR_WIDTH}x$SCR_HEIGHT" -backdrop -window root "$file"
pan class="hl sng">'finish recording, start converting' ffmpeg -i "$tmpfile" "$recodir/$(time.uuid).mkv" notify-send 'finish converting' rm "$tmpfile" "$infofile" else tmpfile="$(mktemp --suffix '.mkv')" notify-send 'start recording' # arch wiki way, no audio, less cpu use during capturing (fast?), large file size, need convert afterward xrectsel '%w %h %x %y' | xargs sh -c 'ffmpeg -y -loglevel quiet -f x11grab -framerate 25 -s "$2"x"$3" -i "$DISPLAY+$4,$5" -c:v ffvhuff "$1" & echo $!' shell "$tmpfile" | xargs -I {} printf '%s\t%s' '{}' "$tmpfile" > "$infofile" # another way to get subshell ffmpeg child pid #xrectsel '%w %h %x %y' | xargs sh -c 'ffmpeg -y -f x11grab -framerate 25 -s "$2"x"$3" -i "$DISPLAY+$4,$5" -c:v ffvhuff "$1"' shell "$tmpfile" & #printf '%s\t%s' "$(ps -o pid= --ppid $!)" "$tmpfile" > "$infofile" fi