From e33ad4f128fb8fef2119cf2c71371eaf9c19bd29 Mon Sep 17 00:00:00 2001 From: Sylvain Herlédan Date: Sat, 3 Jun 2017 12:52:03 +0200 Subject: Initial setup with basic tools: vim/dein, tmux, st, tup, X --- bin/sshot.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 bin/sshot.sh (limited to 'bin/sshot.sh') diff --git a/bin/sshot.sh b/bin/sshot.sh new file mode 100755 index 0000000..426d323 --- /dev/null +++ b/bin/sshot.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +set -o nounset +set -o errexit +set -o pipefail + +readonly PRONAME="$(basename "${0}")"; +readonly PROGDIR="$(readlink -f "$(dirname "${0}")")"; +readonly ARGS="${@}"; + +call_scrot() +{ + local dst_dir="${1}"; shift; + scrot '%Y-%m-%d-%T_$wx$h_scrot.png' -e 'mv $f '"${dst_dir}" ${@} + notify-send "Screenshot saved to ${dst_dir}/$(ls -rt1 "${dst_dir}" | tail -1)" +} + +main() +{ + if [ ${#} -eq 0 ]; + then + >&2 echo "You must at least provide the path of the directory where " + >&2 echo "screenshots will be saved" + exit 1 + fi + + call_scrot ${@}; +} + +main ${ARGS} +exit 0 -- cgit v1.2.3-70-g09d2