diff options
-rw-r--r-- | .SRCINFO | 12 | ||||
-rw-r--r-- | PKGBUILD | 15 | ||||
-rwxr-xr-x | slopgun | 8 |
3 files changed, 35 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..85b629253a92 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,12 @@ +pkgbase = slopgun + pkgdesc = Provide a simple script to use `slop` and `shotgun` together to save screenshots + pkgver = 0.1 + pkgrel = 1 + arch = any + license = GPL + depends = slop + depends = shotgun + depends = xclip + noextract = slopgun + +pkgname = slopgun diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..35e140fae00a --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,15 @@ +# Maintainer: Magnus Anderson <magnus@iastate.edu> +pkgname=slopgun +pkgver=0.1 +pkgrel=1 +pkgdesc='Provide a simple script to use `slop` and `shotgun` together to save screenshots' +arch=('any') +license=('GPL') +depends=('slop' 'shotgun' 'xclip') +md5sums=() #autofill using updpkgsums +noextract=('slopgun') + +package() { + mkdir -p "${pkgdir}/usr/bin" + install -D -m755 ../slopgun "${pkgdir}/usr/bin" +} diff --git a/slopgun b/slopgun new file mode 100755 index 000000000000..aac6cd2d6dee --- /dev/null +++ b/slopgun @@ -0,0 +1,8 @@ +#!/bin/sh +sel=$(slop -f "-i %i -g %g") +if [ $# -eq 0 ] ; then + shotgun $sel -f png - | xclip -t image/png -selection clipboard +else + [ -e "$1"'.png' ] && echo "File '$1.png' already exists" && exit 1; + shotgun $sel -f png "$1"'.png' +fi |