dotfiles

Personal dotfiles.
Log | Files | Refs | LICENSE

commit 89d5aa75d375cf7e0fcef0fe1b0cec30b51e1fc2
parent 71372f95611dd2b14ffd0a70b66b682156010140
Author: Arne Swanson <nownpl@0111.click>
Date:   Wed, 15 Aug 2018 23:20:10 -0300

made a better `shot`

Diffstat:
scripts/alert | 2+-
scripts/shot | 43+++++++++++++++++++++++++++++++++++++------
2 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/scripts/alert b/scripts/alert @@ -1,3 +1,3 @@ #!/bin/sh play /usr/share/sounds/freedesktop/stereo/message.oga -q & -(echo $1; sleep 5) | dzen2 -fg "#00ffa6" -bg "#000" -fn "Input Sans:size=8" -ta l -y "-28" & +(echo $1; sleep 5) | dzen2 -fg "#00ffa6" -bg "#000" -fn "Input Sans:italic:size=8" -ta l -y "-28" & diff --git a/scripts/shot b/scripts/shot @@ -1,5 +1,37 @@ -#!/bin/sh -DIRECTORY="${HOME}/files/shot" -import "${DIRECTORY}/$1.png" -echo "${DIRECTORY}/$1.png" | pb -f | tr -d '\n' | xc -alert "Saved screenshot to ${DIRECTORY}/$1.png"- \ No newline at end of file +#!/bin/bash +args=`getopt w $*` +eval set -- "${args}" + +directory="${HOME}/files/shot" +flag_window=0 + +while true; do + case "$1" in + -w) + flag_window=1 + shift + ;; + --) + shift + break + ;; + *) + exit 3 + ;; + esac +done + +if [ -z $1 ]; then + filename="$(date +'screen_%T_%F')" +else + filename="${$1}" +fi + +if [ ${flag_window} -gt 0 ]; then + import -window root "${directory}/${filename}.png" +else + import "${directory}/${filename}.png" +fi + +echo "${directory}/${filename}.png" | pb -f | tr -d '\n' | xc +alert "Saved screenshot to ${directory}/${filename}.png and uploaded to $(xp)"