clipmenu

Simple clipboard management using dmenu
git clone https://git.sinitax.com/cdown/clipmenu
Log | Files | Refs | README | LICENSE | sfeed.txt

commit fa9d01a752a8dc484f59e49aaef4c3c089aca7be
parent da2e4dcf0faf89fac7e7ab7cfb5c6abcd17592a4
Author: Chris Down <chris@chrisdown.name>
Date:   Thu,  8 Mar 2018 22:32:43 -0800

Don't populate ${last_data[any]}

Fixes #67. This used to be useful in order to avoid doing multiple
writes back when we didn't deduplicate in clipmenu client, but now we do
and don't need this. Even more impressively, it actually breaks things!
See #67 for more information.

Diffstat:
Mclipmenud | 15+++++----------
1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/clipmenud b/clipmenud @@ -188,19 +188,14 @@ while true; do debug "New clipboard entry on $selection selection: \"$first_line\"" - # Without checking ${last_data[any]}, we often double write since both - # selections get the same content cache_file_output="$(date +%s%N) $first_line" - if [[ ${last_data[any]} != "$data" ]]; then - filename="$cache_dir/$(cksum <<< "$first_line")" - debug "Writing $data to $filename" - printf '%s' "$data" > "$filename" + filename="$cache_dir/$(cksum <<< "$first_line")" + debug "Writing $data to $filename" + printf '%s' "$data" > "$filename" - debug "Writing $cache_file_output to $cache_file" - printf '%s\n' "$cache_file_output" >> "$cache_file" - fi + debug "Writing $cache_file_output to $cache_file" + printf '%s\n' "$cache_file_output" >> "$cache_file" - last_data[any]=$data last_cache_file_output[$selection]=$cache_file_output if (( CM_OWN_CLIPBOARD )) && [[ $selection != primary ]] &&