Skip to content

Instantly share code, notes, and snippets.

@icy
Last active August 23, 2017 05:00
Show Gist options
  • Select an option

  • Save icy/f11af5a0daa31e87888ee0f424a7f623 to your computer and use it in GitHub Desktop.

Select an option

Save icy/f11af5a0daa31e87888ee0f424a7f623 to your computer and use it in GitHub Desktop.
Take screenshot with xfce4-screenshooter...
#!/bin/bash
# Purpose : Wrapper for xfce4-screenshooter
# Author : Ky-Anh Huynh
# License : Public domain
# Date : 2017-Aug-23rd
# See also https://www.gtk.org/api/2.6/glib/glib-Miscellaneous-Utility-Functions.html#g-get-tmp-dir
export TMPDIR=$HOME/df/ss/
# set -x
if (( $# )); then
_FILE="$1"
if [[ ! -f "$_FILE" ]]; then
echo >&2 ":: File does not exist \"$_FILE\""
exit 1
fi
_F_JPEG="$TMPDIR/$(basename "$_FILE" .png).jpg"
convert -quality 85 "$_FILE" "$_F_JPEG"
rm -fv "$_FILE"
gliv "$_F_JPEG"
else
xfce4-screenshooter --open "$0" --region
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment