Updated scrot.sh to be more in line with what I wanted
This commit is contained in:
parent
5e3dfb6d4e
commit
cdd023166d
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
remote="https://boop.icu"
|
||||||
|
sound="${HOME}/.local/share/sounds/success.ogg"
|
||||||
|
|
||||||
|
url=$(curl -F"file=@$1" $remote)
|
||||||
|
echo "$url" | xsel -ib
|
||||||
|
|
||||||
|
mpv $sound
|
40
bin/scrot.sh
40
bin/scrot.sh
|
@ -1,12 +1,38 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Siina's bootleg screenshot capturer for use with global keybinds
|
||||||
|
#
|
||||||
|
# Requires:
|
||||||
|
# - scrot: takes the screenshot
|
||||||
|
# - convert: from imagemagick, used to crop single-monitor scrot
|
||||||
|
# - mpv: plays audio file upon completion
|
||||||
|
# - boop.sh: uploads screenshot to boop.icu
|
||||||
|
#
|
||||||
|
# Example global keybinds:
|
||||||
|
#
|
||||||
|
# TYPE CMD KEYBIND
|
||||||
|
#
|
||||||
|
# Fullscreen scrot.sh Print
|
||||||
|
# Current monitor scrot.sh -a Meta+Shift+Print
|
||||||
|
# Active window scrot.sh -u Meta+Print
|
||||||
|
# Region scrot.sh -s Meta+Ctrl+Print
|
||||||
|
#
|
||||||
|
# TODO: Autodetect mpv and boop.sh to make them optional
|
||||||
|
# TODO: Figure out how to capture a specific monitor, not just main
|
||||||
|
|
||||||
dest="$HOME/Screenshots"
|
screendir="$HOME/Screenshots/"
|
||||||
|
sound="$HOME/.local/share/sounds/shutter.ogg"
|
||||||
|
filename="$(date +'%Y%m%d_%H%M%S').png"
|
||||||
|
resolution="1920x1080"
|
||||||
|
|
||||||
# Check to make sure destination directory exists
|
cd $screendir
|
||||||
if [ -d "$dest" ]; then
|
|
||||||
mkdir -p "$dest"
|
if [[ ${1} == "-a" ]]; then
|
||||||
|
scrot $filename
|
||||||
|
# Scrot doesn't capture per monitor so we're doing some jiggery
|
||||||
|
convert -crop 1920x1080\! $filename $filename
|
||||||
|
else
|
||||||
|
scrot $1 $filename
|
||||||
fi
|
fi
|
||||||
|
$HOME/.local/bin/boop.sh "$screendir$filename"
|
||||||
|
|
||||||
# Unable to use $dest and still need to figure out why
|
|
||||||
scrot '%Y%m%d-%H.%M.%S_$wx$h.png' $@ -e 'mv $f ~/Screenshots'
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue