2020-07-01 13:42:14 +03:00
|
|
|
#!/bin/sh
|
2020-11-11 02:49:54 +02:00
|
|
|
#
|
|
|
|
# Siina's bootleg screenshot capturer for use with global keybinds
|
|
|
|
#
|
|
|
|
# Requires:
|
2020-11-21 10:17:18 +02:00
|
|
|
# - maim: takes the screenshot
|
2020-11-11 02:49:54 +02:00
|
|
|
# - 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
|
2020-11-21 10:17:18 +02:00
|
|
|
# Main monitor scrot.sh --main Meta+Ctrl+Print
|
|
|
|
# Active window/Selct scrot.sh -s Meta+Print
|
2020-11-11 02:49:54 +02:00
|
|
|
#
|
|
|
|
# TODO: Autodetect mpv and boop.sh to make them optional
|
|
|
|
# TODO: Figure out how to capture a specific monitor, not just main
|
2020-07-01 13:42:14 +03:00
|
|
|
|
2020-11-13 05:57:04 +02:00
|
|
|
screendir="$HOME/Nextcloud/Screenshots/"
|
|
|
|
sound="${HOME}/src/local-bin/sounds/shutter.ogg"
|
2020-11-11 02:49:54 +02:00
|
|
|
filename="$(date +'%Y%m%d_%H%M%S').png"
|
|
|
|
resolution="1920x1080"
|
2020-11-21 10:17:18 +02:00
|
|
|
args="-m 9 -u"
|
2020-07-01 13:42:14 +03:00
|
|
|
|
2020-11-11 02:49:54 +02:00
|
|
|
cd $screendir
|
|
|
|
|
2020-11-21 10:17:18 +02:00
|
|
|
if [[ ${1} == "--main" ]]; then
|
|
|
|
args="${args} -g 1920x1080+0+0"
|
2020-11-11 02:49:54 +02:00
|
|
|
else
|
2020-11-21 10:17:18 +02:00
|
|
|
args="${args} ${1}"
|
2020-07-01 13:42:14 +03:00
|
|
|
fi
|
2020-11-21 10:17:18 +02:00
|
|
|
maim $args $filename
|
|
|
|
|
2020-11-13 05:57:04 +02:00
|
|
|
mpv $sound
|
2020-11-11 02:49:54 +02:00
|
|
|
$HOME/.local/bin/boop.sh "$screendir$filename"
|
2020-07-01 13:42:14 +03:00
|
|
|
|