commit fc7f47f81f2b7ad8640d9c74ea22f6b536b6ac10 parent 058515d8ef8a7ba974dd8d73ebaa9ecb7230df12 Author: Chris Down <chris@chrisdown.name> Date: Thu, 26 Mar 2020 00:35:12 +0000 clipmenud: Store the last data on reenabling Diffstat:
M | clipmenud | | | 8 | ++++++++ |
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/clipmenud b/clipmenud @@ -67,6 +67,14 @@ sig_enable() { info "Received enable signal but we're not disabled, so doing nothing" return fi + + # Still store the last data so we don't end up eventually putting it in the + # clipboard if it wasn't changed + for selection in "${selections[@]}"; do + data=$(_xsel -o --"$selection"; printf x) + last_data_sel[$selection]=${data%x} + done + info "Received enable signal, resuming clipboard capture" _CM_DISABLED=0 }