Fix file naming and add some cli flags

This commit is contained in:
Sheldon Lee 2023-06-07 09:43:19 +01:00
parent a084750335
commit 7d6fb682bb

View File

@ -69,7 +69,7 @@ prompt_gif() {
30s\n\
60s
"
option=$(echo -e $options | menucmd)
option=$(echo -e $options | $menucmd)
case $option in
10s)
@ -88,7 +88,7 @@ prompt_gif() {
s_scrot() {
name=$(date +${date_format}_sel.png)
path="${scrot_dir}/${name}"
scrot -a $(slop -f "%x,%y,%w,%h") $path &&
crot -a $(slop -f "%x,%y,%w,%h") $path &&
xclip -sel clip $path -t image/png
}
@ -108,14 +108,14 @@ f_grimshot() {
}
s_grimshot() {
name=$(date +${date_format}_full.png)
name=$(date +${date_format}_sel.png)
path="${scrot_dir}/${name}"
$grimshot save area $path &&
wl-copy --type image/png < $path
}
w_grimshot() {
name=$(date +${date_format}_full.png)
name=$(date +${date_format}_sel.png)
path="${scrot_dir}/${name}"
$grimshot save window $path &&
wl-copy --type image/png < $path
@ -129,9 +129,37 @@ byzanz_gif() {
}
if [[ -n $WAYLAND_DISPLAY ]]; then
case $1 in
-f)
sleep 0.5
f_grimshot
;;
-s)
s_grimshot
;;
-w)
w_grimshot
;;
*)
prompt_wayland
;;
esac
elif [[ -n $DISPLAY ]]; then
case $1 in
-f)
sleep 0.5
f_scrot
;;
-s)
s_scrot
;;
-w)
s_scrot
;;
*)
prompt_xorg
;;
esac
else
echo "Error: No Wayland or X11 display detected" >&2
exit 1