Files
lnx-arch/dots/bin/screenshot.sh

21 lines
747 B
Bash
Raw Permalink Normal View History

2026-02-28 10:17:12 -05:00
#!/usr/bin/env bash
# klevstul :: 26.02
method=$1
2026-02-28 21:05:08 -05:00
outputDir="/home/poq/syncDir/0_downloads/"
timestamp=$(date +%y%m%d-%H%M%S) # get timestamp
2026-02-28 10:17:12 -05:00
ranwrd=$(shuf -n 1 /usr/share/dict/cracklib-small) # get a random word
ranwrd="${ranwrd//[^[:alpha:]]/}" # remove all non-letters (like the ' in "sharecropper's")
2026-02-28 21:19:51 -05:00
filename=${timestamp}_${ranwrd}.png
2026-02-28 21:05:08 -05:00
2026-02-28 21:19:51 -05:00
if [[ "$method" == "monitor" ]] ; then
hyprcap shot -z -c -n -w -o ${outputDir} -f ${filename}
elif [[ "$method" == "region" ]] ; then
2026-02-28 21:05:08 -05:00
hyprcap shot region --freeze --copy --notify --write --output-dir ${outputDir} --filename ${filename}
2026-02-28 21:19:51 -05:00
elif [[ "$method" == "window" ]] ; then
hyprcap shot window:active -z -c -n -w -o ${outputDir} -f ${filename}
2026-02-28 21:05:08 -05:00
fi