Changes to pb script.
This commit is contained in:
parent
ad1713254e
commit
9930348155
1 changed files with 3 additions and 13 deletions
16
_scripts/pb
16
_scripts/pb
|
@ -1,8 +1,4 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# $HOME/.local/bin/pb
|
|
||||||
# upload files to 0x0.st
|
|
||||||
# 0x0 - client for 0x0.st
|
|
||||||
# Usage: `0x0.sh file`
|
|
||||||
|
|
||||||
me=${0##*/}
|
me=${0##*/}
|
||||||
host=https://0x0.st
|
host=https://0x0.st
|
||||||
|
@ -23,9 +19,9 @@ EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
clip() {
|
clip() {
|
||||||
if command -v xclip >/dev/null 2>&1;then
|
if command -v xsel >/dev/null 2>&1;then
|
||||||
echo "$@" | xclip -selection c
|
echo -n "$@" | xsel -l /dev/null
|
||||||
notify-send "0x0" "Successfully uploaded.\nURL: $@"
|
dunstify -u normal "content uploaded" "$@"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,12 +58,6 @@ upload_url() {
|
||||||
clip "${uploaded}"
|
clip "${uploaded}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# 1KiB = 1024 bytes
|
|
||||||
# 1MiB = 1024 KiB
|
|
||||||
# max size - 256MiB
|
|
||||||
|
|
||||||
max_size=$(( (1024*1024) * 256 ))
|
|
||||||
|
|
||||||
if [[ -f "$1" || "$#" -lt 1 ]];then
|
if [[ -f "$1" || "$#" -lt 1 ]];then
|
||||||
mode="default"
|
mode="default"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue