Created
November 9, 2020 02:52
-
-
Save hungtcs/426e1fa157330c0dc8069e1486342d92 to your computer and use it in GitHub Desktop.
Linux Shell Software Clipboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
此脚本提供简单的文字粘贴板功能
复制文字
粘贴文字