/usr/share/epic5/script/paste is in epic5 1.1.6-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | if (word(2 $loadinfo()) != [pf]) { load -pf $word(1 $loadinfo()); return; };
#
# Here's the plan...
#
# We want a scripted /set paste, when we turn it on, it sends whatever we type
# to the current target. We also need to be able to turn it off automatically
# because we won't be able to type any commands while it's active. We need
# to be able to configure the timeout, and we also want to be able to strip
# any leading whitespace on the lines we paste. (AnguzHawk asked for this
# feature particularly.)
#
load addset;
# Uncomment this if you want a key binding.
bind ^P parse_command { set paste toggle; };
# # #
addset paste bool {
if (*0 == 'on') {
setup_paste;
xecho -c -b PASTE automatically turns off in $paste_delay seconds;
} elsif (*0 == 'off') {
remove_paste;
};
};
set paste off;
addset paste_strip bool;
set paste_strip 0;
addset paste_delay int;
set paste_delay 30;
# # #
alias setup_paste
{
stack push bind ^I;
bind ^I self_insert;
stack push on input;
on input -*;
on ^input * {
if (getset(paste_strip) == 'ON') {
//send $0 $1-;
} else {
//send $*;
};
};
timer -refnum PASTEOFF $getset(paste_delay) set paste off;
};
# The 'defer' is for epic clients before epic4-1.1.8
alias remove_paste
{
on input -*;
stack pop on input;
stack pop bind ^I;
defer ^timer -delete PASTEOFF;
};
#hop'y2k3
|