Cleanup: remove "functions" dir

This commit is contained in:
crater2150 2020-02-27 15:43:27 +01:00
parent bbd9165820
commit f70f465a37
7 changed files with 0 additions and 104 deletions

View file

@ -1,5 +0,0 @@
#!/bin/zsh
# for debugging: prefix any command with @ to print it before execution
function @() {
echo "$*"; "$@"
}

View file

@ -1,13 +0,0 @@
#!/bin/zsh
function bookmarks() {
typeset -A bookmarks
while read k v; do bookmarks[$k]="$v"; done < ~/.bookmarks
target=$(printf "%s\n" ${(k)bookmarks} | fzf)
cd ${~bookmarks[$target]}
}
function zle-bookmarks() {
bookmarks
zle reset-prompt
}
zle -N zle-bookmarks

View file

@ -1,10 +0,0 @@
autoload -U zfinit && zfinit
zmodload zsh/zftp
imagepush() {
zfopen "crater2150.de" "ftp33701-crimages" \
"$(gpg -d $HOME/.passwords/imagepush)"
zfcd /
zfput $* && echo "Transfer succesful"
zfclose
}

View file

@ -1,18 +0,0 @@
#!/bin/zsh
lesswrap() {
cmd="$1"
alias $cmd="autoless command ${*}"
}
autoless() {
out=$("$@")
((lim=$LINES-1))
numlines=$(echo $out | wc -l)
if (( $numlines > $lim )); then
echo $out | less
else
echo $out
fi
}

View file

@ -1,13 +0,0 @@
function parent-user() {
pid=${1:-$$}
uid=${2:-$(piduser $pid)}
stat=($(</proc/${pid}/stat))
ppid=${stat[4]}; echo $ppid
puid=$(piduser $ppid )
if [[ ${puid} != $uid ]]; then
echo ${puid}
elif [[ $ppid != 1 ]]; then
parent-user ${ppid}
fi
}