Last active
December 29, 2022 01:40
-
-
Save mkhan45/b13b70218e6ed673be44c7e0f33bdc66 to your computer and use it in GitHub Desktop.
Screenshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Relies on https://github.com/neXromancers/shotgun
and https://github.com/naelstrof/slop
and https://github.com/astrand/xclip