wayland-screenshot

This commit is contained in:
q3aql 2025-05-17 12:17:02 +02:00
parent 0cd9faa298
commit b3349c499f

View File

@ -1,19 +1,20 @@
#!/bin/bash
FILEDIR=~/Downloads
FILEDIR=~/Screenshots
OPTION=()
mkdir -p $FILEDIR
values=$(zenity \
--title=wayland-screenshot \
--text="Option" \
--forms \
--add-combo="Mode" \
--combo-values="All screen|Specific window|Specific area" \
--combo-values="Specific area|Specific window|All screen" \
--add-combo="Include cursor[default: no]" \
--combo-values="no|yes" \
--add-entry="time to wait[default: 0s]" \
--add-combo="Copy to clipboard[default: yes]" \
--combo-values="yes|no" \
--add-combo="Copy to clipboard[default: no]" \
--combo-values="no|yes" \
)
result=$?
@ -38,7 +39,7 @@ if [ -z "$mode" ] ;then # select nothing
--title=wayland-screenshot \
--width=200 \
--warning \
--text="Mode empty"
--text="Specific area"
exit
fi
@ -65,8 +66,14 @@ if [ -z "$clipboard" ] || [ "$clipboard" == yes ];then
else
if [ -z "$GEO" ]; then
grim $OPTION $FILEDIR/Screenshot_$(date +%F_%H.%M.%S).png
if [ -f /usr/bin/ristretto ] ; then
ristretto $FILEDIR/Screenshot_$(date +%F_%H.%M.%S).png
fi
else
grim $OPTION -g "$GEO" $FILEDIR/Screenshot_$(date +%F_%H.%M.%S).png
if [ -f /usr/bin/ristretto ] ; then
ristretto $FILEDIR/Screenshot_$(date +%F_%H.%M.%S).png
fi
fi
fi