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