commit dd9a04184665cca972f0fbaf5b8e1c07dd0b079a parent 65f0b277ec6305ed2e7bd92e6747c63bb6025f62 Author: Chris Down <chris@chrisdown.name> Date: Wed, 5 Feb 2014 17:45:23 +0800 Copy from both clipboard and primary selections Diffstat:
M | clipmenud | | | 16 | ++++++++-------- |
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/clipmenud b/clipmenud @@ -1,15 +1,15 @@ #!/bin/bash -selection=${1-clipboard} cache_dir=/tmp/clipmenu/ - mkdir -p "$cache_dir" while sleep 1; do - data=$(xsel --"$selection"; printf x) - data=${data%x} - md5=$(md5sum <<< "$data") - md5=${md5%% *} - - cat > "$cache_dir/$md5" <<< "$data" + for selection in clipboard primary; do + data=$(xsel --"$selection"; printf x) + data=${data%x} + md5=$(md5sum <<< "$data") + md5=${md5%% *} + + cat > "$cache_dir/$md5" <<< "$data" + done done