zsh: Delete unused parts and bits

Delete:
 - transfer.zsh
 - zsh-async
 - telegram helper functions + completion
 - TERM hack for kitty terminal
This commit is contained in:
2020-10-06 22:22:42 +02:00
parent 0424941699
commit 72159411b9
7 changed files with 0 additions and 110 deletions

View File

@@ -1,10 +0,0 @@
## Author: druckdev
## Created: 2019-08-18
## TelegramCLI msg completion
function tg-completion() {
contactList=( $(telegram-cli -W -C -e "contact_list" | tail -n +9 | head -n -2 | grep -vE "(>>>|<<<|»»»|«««)" | sed 's/ /_/g; s/.*\[K//; s/(/\\(/g; s/)/\\)/g; s/"/\\"/g') )
echo '#compdef msg' >! $ZSH_CONF/completion/_msg
echo >> $ZSH_CONF/completion/_msg
echo '_arguments "1:<Recipient>:('"$contactList[*]"')"' >> $ZSH_CONF/completion/_msg
}

View File

@@ -34,27 +34,6 @@ function mkcd () {
fi
}
## Send a message over telegram by using the -e flag
function msg() {
if [[ $# -ge 2 ]]; then
telegram-cli -W -e "msg $*" | grep -E "${${*/ /.*}//_/ }"
# | grep -E "$(echo "$*" | sed 's/ /.*/; s/_/ /g')"
else
printf "\033[1;31mPlease specify a contact and a message.\n\033[0m" >&2
fi
}
## Execute tg -e command but cuts of the uninteresting parts
function tg() {
tg="telegram-cli"
if [[ "$1" = "-e" ]]; then
shift
$tg -N -W -e "$@" | tail -n +9 | head -n -2
else
$tg -N -W "$@"
fi
}
## Encode and decode qr-codes
function qr() {
if [[ $# -eq 1 && -r "$1" ]]; then

View File

@@ -1,61 +0,0 @@
#
# Defines transfer alias and provides easy command line file and folder sharing.
#
# Authors:
# Remco Verhoef <remco@dutchcoders.io>
#
curl --version 2>&1 > /dev/null
if [ $? -ne 0 ]; then
echo "Could not find curl."
return 1
fi
transfer() {
# check arguments
if [ $# -eq 0 ];
then
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
fi
# get temporarily filename, output is written to this file show progress can be showed
tmpfile=$( mktemp -t transferXXX )
# upload stdin or file
file=$1
if tty -s;
then
basefile=$(basename "$file" | sed -e 's/[^a-zA-Z0-9._-]/-/g')
if [ ! -e $file ];
then
echo "File $file doesn't exists."
return 1
fi
if [ -d $file ];
then
# zip directory and transfer
zipfile=$( mktemp -t transferXXX.zip )
cd $(dirname $file) && zip -r -q - $(basename $file) >> $zipfile
curl --progress-bar --upload-file "$zipfile" "https://transfer.sh/$basefile.zip" >> $tmpfile
rm -f $zipfile
else
# transfer file
curl --progress-bar --upload-file "$file" "https://transfer.sh/$basefile" >> $tmpfile
fi
else
# transfer pipe
curl --progress-bar --upload-file "-" "https://transfer.sh/$file" >> $tmpfile
fi
# cat output link
cat $tmpfile
# cleanup
rm -f $tmpfile
}