From 771b32ef53e34020b9623963cc1989c748f11e6b Mon Sep 17 00:00:00 2001 From: Blallo Date: Fri, 16 Dec 2022 16:46:23 +0100 Subject: [PATCH] piknik --- .zshrc | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.zshrc b/.zshrc index a66d018..65fe108 100644 --- a/.zshrc +++ b/.zshrc @@ -399,4 +399,36 @@ function pasteit() { hut paste create ${@} } +### piknik + +# pko : copy to the clipboard +function pko() { + echo "$*" | piknik -copy +} + +# pkf : copy the content of to the clipboard +function pkf() { + piknik -copy < $1 +} + +# pkc : read the content to copy to the clipboard from STDIN +alias pkc='piknik -copy' + +# pkp : paste the clipboard content +alias pkp='piknik -paste' + +# pkm : move the clipboard content +alias pkm='piknik -move' + +# pkz : delete the clipboard content +alias pkz='piknik -copy < /dev/null' + +# pkfr [] : send a whole directory to the clipboard, as a tar archive +function pkfr() { + tar czpvf - ${1:-.} | piknik -copy +} + +# pkpr : extract clipboard content sent using the pkfr command +alias pkpr='piknik -paste | tar xzpvf -' + # vim: set ft=zsh et sw=0 ts=2 sts=0: