1
1
mirror of https://github.com/rywng/dotfiles.git synced 2024-11-25 04:11:49 +08:00
dotfiles/.config/sway/scripts/grimshot-ui.sh
juan 84ad436aeb Update screenshot utilitys' code.
boxshadow.sh:   Add a tips for what this script does.
grimshot-ui.sh: Move the box shadow editing part to this script.
grimshot.sh:    Same as above, to make the grimshot-ui a pure wrapper
to this and grim, making the codebase cleaner.
2022-04-22 00:13:06 +08:00

23 lines
716 B
Bash
Executable File

#!/bin/sh
SCRIPT_LOC=~/.config/sway/scripts/
FILE="/tmp/share/screenshots/`date +'%y%m%d%H%M.png'`"
action=`echo "copy\nsave" | wofi -d -Oalphabetical --prompt="Select your action"`
target=`echo "active\nscreen\noutput\narea\nwindow" | wofi -d -Oalphabetical --prompt="Select the target"`
test $action || exit
test $target || exit
test -d /tmp/share/screenshot || mkdir -p /tmp/share/screenshots
# TODO, add box shadows
XDG_SCREENSHOTS_DIR=/tmp/share/screenshots ~/.config/sway/scripts/grimshot.sh --notify $action $target $FILE
if [ $target = "active" ] || [ $target = "window" ] || [ $target = "area" ]
then
$SCRIPT_LOC/boxshadow.sh "$FILE" "$FILE" || die "Unable to save screenshot"
echo "saved file"
fi