Skip to content

Commit

Permalink
Intergrate Swappy to edit screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
arran-nz authored Mar 20, 2021
1 parent 29972a4 commit 4921171
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ If you are using Archlinux, you can install sway-interactive-screenshot with the
- `rofi` to prompt what you want to take a screenshot of
- `grim` to take the screenshot
- `slurp` to select an area on the screen
- [`swappy`](https://github.com/jtheoof/swappy) (optional) to edit the captured screenshot
- `notify-send` to send a notification to notification daomon (such as [`mako`](https://github.com/emersion/mako))
- `wl-copy` to copy the screenshot to the clipboard

Expand Down
19 changes: 19 additions & 0 deletions sway-interactive-screenshot
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,24 @@ case $CHOICE in
grim -g "$GEOMETRY" "$EXPENDED_FILENAME"
esac
# If swappy is installed, prompt the user to edit the captured screenshot
if command -v swappy $>/dev/null
then
EDIT_CHOICE=`rofi -dmenu -p 'Edit' -lines 2 << EOF
yes
no
EOF`
case $EDIT_CHOICE in
yes)
swappy -f "$EXPENDED_FILENAME" -o "$EXPENDED_FILENAME"
;;
no)
;;
'')
;;
esac
fi
wl-copy < "$EXPENDED_FILENAME"
notify-send "Screenshot" "File saved as <i>'$FILENAME'</i> and copied to the clipboard." -i "$EXPENDED_FILENAME"

0 comments on commit 4921171

Please sign in to comment.