Go straight to the code sclipboard.sh
#!/usr/bin/env bash
CONFIG_FOLDER=~/.config/scopy-paste
CONFIG_FILE="$CONFIG_FOLDER/value"
if [ ! -d "$CONFIG_FOLDER" ]; then
mkdir -p "$CONFIG_FOLDER";
fi
function scopy() {
echo -n ${*:-`cat`} > "$CONFIG_FILE";
}
function spaste() {
if [ -f "$CONFIG_FILE" ]; then
echo -n $(cat "$CONFIG_FILE");
fi
}
Usage mode
First source sclipboard.sh
.
# Copy path
pwd | scopy
# Paste path
ls -l $(spaste)