diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2016-05-30 17:47:32 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2016-05-30 17:47:32 +0200 |
| commit | 8d75b6922b00ba202db2210fc0caa0c265f18035 (patch) | |
| tree | fab9deabd7c9f9f403592e0313bfb3539eee7019 /config/fish/functions/pp.fish | |
| parent | 55fbff7d76ba4d40882a18dde6deaf25a71c8951 (diff) | |
| download | dotfiles-8d75b6922b00ba202db2210fc0caa0c265f18035.tar.gz dotfiles-8d75b6922b00ba202db2210fc0caa0c265f18035.zip | |
add pp function
A function to prevent clipboard hijacking.
See: https://github.com/Aaronmsv/PastejackingProtection
Diffstat (limited to 'config/fish/functions/pp.fish')
| -rw-r--r-- | config/fish/functions/pp.fish | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/config/fish/functions/pp.fish b/config/fish/functions/pp.fish new file mode 100644 index 0000000..6cd9161 --- /dev/null +++ b/config/fish/functions/pp.fish @@ -0,0 +1,17 @@ +function pp --description 'safely execute content from the clipboard' + # fish version of https://github.com/Aaronmsv/PastejackingProtection + + if not type -q xclip + echo please install xclip + return + end + + set script (xclip -o) + echo "$script" | cat -A + echo -e "\nExecute? (y/N): " + read execute + + if test "$execute" = "y" + eval $script + end +end |
