wl-screenshot 578 B

1234567891011121314151617181920212223
  1. #!/bin/sh
  2. . ~/.zshenv
  3. if [ "$1" = "help" ]; then
  4. echo "*** Description ***"
  5. echo "Takes a screenshot using slurp and grim then copys to clipboard using wl-copy"
  6. echo ""
  7. echo "*** Usage ***"
  8. echo "wl-screenshot"
  9. echo ""
  10. echo "*** Parameters ***"
  11. echo ""
  12. echo "*** Options ***"
  13. echo ""
  14. exit 0
  15. fi
  16. [ ! -d "$PICTURES"/screenshots ] && mkdir -p "$PICTURES"/screenshots
  17. PIC_NUM="$(find "$PICTURES"/screenshots/ | wc -l)"
  18. slurp | grim -g - "$PICTURES"/screenshots/scrn-"$PIC_NUM".png
  19. wl-copy < "$PICTURES"/screenshots/scrn-"$PIC_NUM".png