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

View File

@ -11,9 +11,6 @@
# #
# Example global keybinds can be found in scrotsh.khotkeys # 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 source ~/.profile # Workaround to avoid using /bin/bash
# Edit these to fit setup # Edit these to fit setup
@ -41,7 +38,6 @@ if [[ ${1} == "--select" ]]; then
args="$args ${1}" args="$args ${1}"
elif [[ ${1} == "--main" || ${1} == "--secondary" ]]; then elif [[ ${1} == "--main" || ${1} == "--secondary" ]]; then
args="$args -g $resolution" args="$args -g $resolution"
fi fi
# Take the screenshot with maim # Take the screenshot with maim