Removing mpv as dependency for scrot.sh and boop.sh

This commit is contained in:
Siina Mashek 2022-07-05 09:49:39 +03:00
parent 691e68d90a
commit 6565eafc58
2 changed files with 6 additions and 7 deletions

View file

@ -15,6 +15,6 @@ if [[ ! -n "$(which curl)" ]]; then echo "Please install curl"; exit; fi
url=$(curl -F"file=@$1" $remote)
echo "$url" | tr -d '\n' | xsel -ib -l /tmp/xsel.log
if [[ -n "$(which mpv)" ]]; then
mpv $sound
if [[ -n "$(which ffplay)" ]]; then
ffplay $sound -nodisp -autoexit -loglevel error
fi

View file

@ -5,7 +5,6 @@
# Requires:
# - maim: takes the screenshot
# - imagemagick: for custom resolution sizes
# - mpv: plays audio file upon completion
# - boop.sh: uploads screenshot to boop.icu
# - Checks for SCREENSHOT_DIR environment variable
#
@ -16,7 +15,7 @@ source ~/.profile # Workaround to avoid using /bin/bash
# Edit these to fit setup
sound="$HOME/Projects/local-bin/sounds/shutter.ogg"
filename="$(date +'%Y%m%d_%H%M%S').png"
main_res="1920x1080+0+510"
main_res="1920x1080+0+521"
secondary_res="1080x1920+1920+0"
# Ensure screenshot directory is there so the script will work
@ -48,9 +47,9 @@ if [[ ${1} == "--main" ]]; then
magick convert $filename -trim +repage $SCREENSHOT_DIR/$filename
fi
# Play sound if mpv is available
if [[ -n "$(which mpv)" ]]; then
mpv $sound
# Play sound if ffplay is available
if [[ -n "$(which ffplay)" ]]; then
ffplay $sound -nodisp -autoexit -loglevel error
fi
# Upload to boop if boop.sh is available