From b3349c499f9b7c8709904d1bd619ae2d4b8b4695 Mon Sep 17 00:00:00 2001 From: q3aql Date: Sat, 17 May 2025 12:17:02 +0200 Subject: [PATCH] wayland-screenshot --- .config/sway/wayland-screenshot | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.config/sway/wayland-screenshot b/.config/sway/wayland-screenshot index 6c82e74..6465255 100755 --- a/.config/sway/wayland-screenshot +++ b/.config/sway/wayland-screenshot @@ -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