Refactored boop.sh, cleaned up scrot.sh

This commit is contained in:
Siina Mashek 2022-03-13 08:39:13 +02:00
parent 99f05b6723
commit 7a273fabd5
2 changed files with 12 additions and 10 deletions

View File

@ -1,14 +1,20 @@
#!/bin/sh
#
# Siina's bootleg boop.icu uploader
#
# Requires:
# - xsel: for clipboard manipulation
# - curl: for uploading
remote="https://boop.icu"
sound="$HOME/Projects/local-bin/sounds/success.ogg"
if [ ! -f "/usr/bin/xsel" ]; then
echo "Please install xsel"
exit
fi
# Make sure necessary applications are installed
if [[ ! -n "$(which xsel)" ]]; then; echo "Please install xsel"; exit; fi
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
mpv $sound
if [[ -n "$(which mpv)" ]]; then
mpv $sound
fi

View File

@ -11,9 +11,6 @@
#
# Example global keybinds can be found in scrotsh.khotkeys
#
# TODO: Figure out how to capture a specific monitor, not just main
# TODO: Remove hardcoded shutter sound path
source ~/.profile # Workaround to avoid using /bin/bash
# Edit these to fit setup
@ -41,7 +38,6 @@ if [[ ${1} == "--select" ]]; then
args="$args ${1}"
elif [[ ${1} == "--main" || ${1} == "--secondary" ]]; then
args="$args -g $resolution"
fi
# Take the screenshot with maim