Skip to content
Snippets Groups Projects
Unverified Commit 5792d7e3 authored by Volkor The Barbarian Warrior's avatar Volkor The Barbarian Warrior
Browse files

delete leftovers from merge

parent eb66d5e0
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
set -e
install() {
sudo install -C upload.sh /usr/bin/upload
echo "Installed: upload tool"
sudo install -C screenshot.sh /usr/bin/screenshot
echo "Installed: screenshot tool"
}
checkpkg() {
[ -x "$(which $1)" ]
}
func_apt-get() {
echo "Detected Package Manager: apt/apt-get. Installing packages"
sudo apt install curl xclip libnotify-bin maim
}
func_yum() {
echo "Detected Package Manager: yum. Installing packages"
echo "WARNING: untested on this system, if it does work please tell me."
sudo yum install curl xclip libnotify
echo "Warning: maim is not in the repositories install it here: https://github.com/naelstrof/maim"
}
func_pacman() {
echo "Detected Package Manager: pacmam. Installing packages"
echo "WARNING: untested on this system, if it does work please tell maintainer."
sudo pacman -S curl xclip libnotify maim
}
func_zypper() {
echo "Detected Package Manager: zypper. Installing packages"
echo "WARNING: untested on this system, if it does work please tell maintainer."
sudo zypper in curl xclip libnotify maim
}
if checkpkg apt-get ; then func_apt-get
elif checkpkg yum ; then func_yum
elif checkpkg pacman ; then func_pacman
elif checkpkg zypper ; then func_zypper
else
echo 'No package manager found, install the packages manually. (curl xclip libnotify maim) and copy the files manually (read README.md)'
exit 2
fi
install
#!/bin/bash
# Takes a region screenshot and saves it.
# Depends:
# - maim
# - upload.sh (bundled)
# TODO:
# - Setting to delete screenshot
# - Options (-f fullscreen, -s selection, -h help,
# Settings
SCREENSHOT="${HOME}"/Pictures/screenshots/`date +%Y-%m-%d\(%H:%M:%S\)`.png # By default, save screenshot to tmp, for screenshot uploading.
# Functions
function screenshot {
echo "Click and hold to select screenshot area"
maim -s -o ${SCREENSHOT}
}
# '''Logic'''
screenshot
# Comment these lines if you want to only save the screenshot
exec upload ${SCREENSHOT}
\ No newline at end of file
#!/bin/bash
# Upload files to https://p.thecum.zone/ copying URL to clipboard.
# ---------------------------------
# Depends:
# - curl
# - xclip
#
# Optional Depends:
# - libnotify-bin (to say image has been uploaded)
# TODO:
# - Implement config file for key based auth.
# Default Config
SITE=https://thecum.zone/
# Functions
FILE=$1
upload(){
echo "Uploading File: ($FILE)"
URL=`curl --progress-bar -F file=@"$FILE" $SITE | grep -Eo 'https://thecum.zone/[^/"]+'`
echo ${URL} | tr -d '\n' | xclip -selection clipboard || true
echo "URL: ${URL}"
notify
}
notify(){
notify-send "File uploaded (Copied to clipboard)" "URL: ${URL}" || true
}
uploadPipe(){
rand=`head -c 48 /dev/urandom | tr -dc 'a-zA-Z0-9'`
foo=$(</dev/stdin)
echo "$foo" > /tmp/$rand.txt
FILE=/tmp/$rand.txt
upload
}
#'''''Logic'''''
if [ ! -e "$FILE" ]; then
uploadPipe
else
upload
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment