summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD9
-rwxr-xr-xi3-scrot56
3 files changed, 53 insertions, 18 deletions
diff --git a/.SRCINFO b/.SRCINFO
index f1fec0a86218..d7378015a0cf 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,10 +1,10 @@
# Generated by mksrcinfo v8
-# Thu Mar 10 11:47:42 UTC 2016
+# Sat Jul 20 06:45:47 UTC 2019
pkgbase = i3-scrot
pkgdesc = simple screenshot script using scrot
pkgver = 1.0
- pkgrel = 1
- url = https://forum.manjaro.org/index.php?topic=31977.msg261964#msg261964
+ pkgrel = 2
+ url = https://gitlab.manjaro.org/packages/community/i3/i3-scrot
arch = any
license = GPL
depends = libnotify
diff --git a/PKGBUILD b/PKGBUILD
index cea4bd7b3a1e..a794fbe0e734 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,17 +1,18 @@
# Maintainer: Bernhard Landauer <oberon@manjaro.org>
pkgname=i3-scrot
-pkgver=1.0
-pkgrel=1
+pkgver=2.1
+pkgrel=2
pkgdesc="simple screenshot script using scrot"
arch=('any')
-url="https://forum.manjaro.org/index.php?topic=31977.msg261964#msg261964"
+url="https://gitlab.manjaro.org/packages/community/i3/i3-scrot"
license=('GPL')
depends=('libnotify'
'scrot'
+ 'xclip'
'xdg-user-dirs')
source=('i3-scrot')
-md5sums=('b6710609e1c14bd190bd049069ceb64e')
+md5sums=('38d327f007f6cbd9113fa02ca516e532')
package() {
install -Dm755 "$srcdir/$pkgname" "$pkgdir/usr/bin/$pkgname"
diff --git a/i3-scrot b/i3-scrot
index 15229f630ef6..4ed200a817cb 100755
--- a/i3-scrot
+++ b/i3-scrot
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# /usr/bin/i3-scrot
#
# simple screenshot-script using scrot for manjaro-i3 by oberon@manjaro.org
@@ -15,16 +15,22 @@ if ! [ -d $scrot_dir ]; then
mkdir -p $scrot_dir
fi
+if ! [[ -z "$2" ]]; then
+ cmd="scrot -d $2"
+else
+ cmd='scrot'
+fi
+
case "$1" in
--desk|-d|$NULL)
cd $scrot_dir
- scrot &&
+ $cmd &&
sleep 1 &&
notify-send "screenshot has been saved in $scrot_dir"
;;
--window|-w)
cd $scrot_dir
- scrot -u &&
+ $cmd -u &&
sleep 1 &&
notify-send "screenshot has been saved in $scrot_dir"
;;
@@ -34,13 +40,38 @@ case "$1" in
scrot -s &&
sleep 1 && notify-send "screenshot has been saved in $scrot_dir"
;;
+ --desk-to-clipboard|-dc|$NULL)
+ cd $scrot_dir
+ scrot -e 'xclip -selection clipboard -t image/png -i $f && rm $f' &&
+ sleep 1 &&
+ notify-send "screenshot has been copied to clipboard"
+ ;;
+ --window-to-clipboard|-wc)
+ cd $scrot_dir
+ scrot -u -e 'xclip -selection clipboard -t image/png -i $f && rm $f' &&
+ sleep 1 &&
+ notify-send "screenshot has been copied to clipboard"
+ ;;
+ --select-to-clipboard|-sc)
+ cd $scrot_dir
+ notify-send 'select an area for the screenshot' &
+ scrot -s -e 'xclip -selection clipboard -t image/png -i $f && rm $f' &&
+ sleep 1 && notify-send "screenshot has been copied to clipboard"
+ ;;
--help|-h)
echo "
available options:
--d | --desk full screen
--w | --window active window
--s | --select selection
--h | --help display this information
+-d | --desk full screen
+-w | --window active window
+-s | --select selection
+-dc | --desk-to-clipboard full screen to clipboard
+-wc | --window-to-clipboard active window to clipboard
+-sc | --select-to-clipboard selection to clipboard
+-h | --help display this information
+
+The -d, -w, -dc, and -wc options can be used with a delay
+by adding the number of seconds, like for example:
+'i3-scrot -w 5'
Default option is 'full screen'.
@@ -53,10 +84,13 @@ Default is $scrot_dir
== ! i3-scrot: missing or wrong argument ! ==
available options:
--d | --desk full screen
--w | --window active window
--s | --select selection
--h | --help display this information
+-d | --desk full screen
+-w | --window active window
+-s | --select selection
+-dc | --desk-to-clipboard full screen to clipboard
+-wc | --window-to-clipboard active window to clipboard
+-sc | --select-to-clipboard selection to clipboard
+-h | --help display this information
Default option is 'full screen'.