diff options
author | Karel Kočí <cynerd@email.cz> | 2018-09-28 09:57:47 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2018-09-28 09:57:47 +0200 |
commit | 6f6d67d20f12f94cacfc0f85a2548cfbe4b972d1 (patch) | |
tree | d8fff2a7fdf5210e45ae60b3ff22ab3373f9c7c6 /x11-misc/xshot | |
parent | 5ec10057c94f2dd0bbab4639c53d1908d0956b5f (diff) | |
download | gentoo-personal-overlay-6f6d67d20f12f94cacfc0f85a2548cfbe4b972d1.tar.gz gentoo-personal-overlay-6f6d67d20f12f94cacfc0f85a2548cfbe4b972d1.tar.bz2 gentoo-personal-overlay-6f6d67d20f12f94cacfc0f85a2548cfbe4b972d1.zip |
Add xshot package
Diffstat (limited to 'x11-misc/xshot')
-rwxr-xr-x | x11-misc/xshot/files/xshot | 56 | ||||
-rw-r--r-- | x11-misc/xshot/xshot-1.ebuild | 15 |
2 files changed, 71 insertions, 0 deletions
diff --git a/x11-misc/xshot/files/xshot b/x11-misc/xshot/files/xshot new file mode 100755 index 0000000..decebc5 --- /dev/null +++ b/x11-misc/xshot/files/xshot @@ -0,0 +1,56 @@ +#!/bin/sh + +MODE= +OUTPUT= +while [ $# -gt 0 ]; do + case "$1" in + -h|--help) + echo "Usage: xshot [MODE] [OUTPUT]" + echo "Make Xorg screenshot" + echo + echo "Modes:" + echo " window (w)" + echo " screen (s)" + echo " desktop (d)" + echo "Default mode is window." + exit 0 + ;; + window|screen|desktop) + MODE="$1" + ;; + *) + if [ -z "$MODE" ]; then + MODE="$1" + elif [ -z "$OUTPUT" ]; then + OUTPUT="$1" + else + echo "Unknown argument: $1" >&2 + exit 1 + fi + esac + shift +done + +[ -n "$MODE" ] || MODE=window + +case "$MODE" in + window|w) + # TODO how about getting window class and naming it according to it + [ -n "$OUTPUT" ] || OUTPUT="xshot_$(date +%F_%H%M%S_%N).png" + import "$OUTPUT" + ;; + screen|s) + # TODO mode complicated + # https://unix.stackexchange.com/questions/247935/automatically-take-screenshot-of-specific-display-in-x#247936 + # This is going to work but question is how to specify screen/which screen + # is currently active + exit 1 + ;; + desktop|d) + [ -n "$OUTPUT" ] || OUTPUT="xshot_$(date +%F_%H%M%S_%N).png" + import -window root "$OUTPUT" + ;; + *) + echo "Unknown mode: $MODE" >&2 + exit 1 +esac diff --git a/x11-misc/xshot/xshot-1.ebuild b/x11-misc/xshot/xshot-1.ebuild new file mode 100644 index 0000000..8e89304 --- /dev/null +++ b/x11-misc/xshot/xshot-1.ebuild @@ -0,0 +1,15 @@ +EAPI=7 + +DESCRIPTION="Xorg easy and fast screenshot utility script" +HOMEPAGE="http://git.cynerd.cz/gentoo-personal-overlay/" +S="${WORKDIR}" + +LICENSE="GPL-3.0+" +SLOT="0" +KEYWORDS="amd64 x86" + +RDEPEND="media-gfx/imagemagick" + +src_install() { + doexe "${FILESDIR}/xshot" +} |