2022-06-25 21:26:38 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
SCRIPT_LOC=~/.config/sway/scripts/
|
2023-07-16 09:49:32 +08:00
|
|
|
FOLDER=~/Pictures/Screenshots/
|
|
|
|
# FILE="/tmp/share/screenshots/`date +'%y%m%d%H%M.png'`"
|
|
|
|
FILE="$FOLDER`date +'%y%m%d%H%M.png'`"
|
2022-06-25 21:26:38 +08:00
|
|
|
|
2023-07-16 09:49:32 +08:00
|
|
|
action=`echo -e "copy\nsave" | wofi -d -Oalphabetical --prompt="Select your action"`
|
|
|
|
target=`echo -e "active\nscreen\noutput\narea\nwindow" | wofi -d -Oalphabetical --prompt="Select the target"`
|
2022-06-25 21:26:38 +08:00
|
|
|
|
|
|
|
test $action || exit
|
|
|
|
test $target || exit
|
|
|
|
|
2023-07-16 09:49:32 +08:00
|
|
|
# test -d /tmp/share/screenshot || mkdir -p /tmp/share/screenshots
|
2022-06-25 21:26:38 +08:00
|
|
|
|
2023-07-16 09:49:32 +08:00
|
|
|
~/.config/sway/scripts/grimshot.sh --notify $action $target $FILE
|
2022-06-25 21:26:38 +08:00
|
|
|
|
|
|
|
if [ $target = "active" ] || [ $target = "window" ] || [ $target = "area" ]
|
|
|
|
then
|
|
|
|
$SCRIPT_LOC/boxshadow.sh "$FILE" "$FILE" || die "Unable to save screenshot"
|
2023-07-16 09:49:32 +08:00
|
|
|
echo -e "saved file"
|
2022-06-25 21:26:38 +08:00
|
|
|
fi
|