Skip to content

Instantly share code, notes, and snippets.

@mkhan45
Last active December 29, 2022 01:40
Show Gist options
  • Save mkhan45/b13b70218e6ed673be44c7e0f33bdc66 to your computer and use it in GitHub Desktop.
Save mkhan45/b13b70218e6ed673be44c7e0f33bdc66 to your computer and use it in GitHub Desktop.
Screenshot
#!/bin/sh
# Usage: sc [DELAY] [OUTPUT]
# Image is copied to clipboard and saved to output
if [ -z "$2" ]
then
file="$(mktemp)"
else
file="/home/$USER/$2"
fi
sel="$(slop -c 0,0,0,0.45 -l -f '-i %i -g %g')"
if [ ! -z "$1" ]
then
sleep $1
fi
shotgun $sel $file
xclip -selection clipboard -t image/png -i $file
if [ -z "$2" ]
then
rm "$file"
fi
@mkhan45
Copy link
Author

mkhan45 commented Oct 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment