aboutsummaryrefslogtreecommitdiff
path: root/config/fish
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2016-05-30 17:47:32 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2016-05-30 17:47:32 +0200
commit8d75b6922b00ba202db2210fc0caa0c265f18035 (patch)
treefab9deabd7c9f9f403592e0313bfb3539eee7019 /config/fish
parent55fbff7d76ba4d40882a18dde6deaf25a71c8951 (diff)
downloaddotfiles-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')
-rw-r--r--config/fish/functions/pp.fish17
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