~sircmpwn/dotfiles

447a8d00afcfe178db9f9a4bce7f8641d973bf1b — Drew DeVault a month ago 40c217a
bin/srht: wayland support; simplify
1 files changed, 3 insertions(+), 16 deletions(-)

M bin/srht
M bin/srht => bin/srht +3 -16
@@ 30,15 30,6 @@ selection() {
	word=selection
}

# This function sets $file to your clipboard contents
clipboard() {
	uploadme="/tmp/scrot.txt"

	xclip -sel clipboard -o > "$uploadme"

	word=clipboard
}

# This function sets $file an url
url() {
	type="$(echo "$location" | rev | cut -d "." -f 1 | rev)"


@@ 82,13 73,12 @@ upload() {
# This function logs the url,  copies the url to the clipboard, and/or opens the url in your browser
feedback() {
	# Copy url to clipboard
	if [ "$clipboard" == true ]; then
		echo "$url" | xclip -selection primary
		echo "$url" | xclip -selection clipboard
	if [ "$clipboard" = "true" ]; then
		printf "$url" | wl-copy
	fi

	# Log url
	if [ "$log" == true ]; then
	if [ "$log" = "true" ]; then
		echo "$url" >> "$logfile"
	fi



@@ 126,9 116,6 @@ then
			echo "srht 0.9.1"
			exit 0
			;;
		-p|--paste)
			clipboard
			;;
		http*)
			location="$@"
			url