~skiqqy/bin

2812c8afd69dbb57043eb971c17c2e1bb5833da0 — Stephen Cochrane 2 months ago 9d8a9f8
Clip only stores uniq copies now
1 files changed, 4 insertions(+), 1 deletions(-)

M clip
M clip => clip +4 -1
@@ 46,6 46,9 @@ paste()
# Put current selection into the buffer
copy()
{
	# Only copy if the element is uniq
	grep -F "$(xclip -o | tr '\n' "$delim")" "$buffer" > /dev/null && return

	if [ ! "$(wc -l "$buffer"| tr -s ' ' | cut -d ' ' -f 1)" -le "$max" ]
	then
		# Remove oldest item, ie top item in file


@@ 57,7 60,7 @@ copy()
	if [ -n "$(xclip -o)" ]
	then
		{
			xclip -o | tr  '\n' "$delim" # Replace new lines with delim char \x1f
			xclip -o | tr '\n' "$delim" # Replace new lines with delim char \x1f
			printf '\n'
		} >> "$buffer"
	else