Copy from both clipboard and primary selections
This commit is contained in:
parent
65f0b277ec
commit
dd9a041846
|
@ -1,11 +1,10 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
selection=${1-clipboard}
|
|
||||||
cache_dir=/tmp/clipmenu/
|
cache_dir=/tmp/clipmenu/
|
||||||
|
|
||||||
mkdir -p "$cache_dir"
|
mkdir -p "$cache_dir"
|
||||||
|
|
||||||
while sleep 1; do
|
while sleep 1; do
|
||||||
|
for selection in clipboard primary; do
|
||||||
data=$(xsel --"$selection"; printf x)
|
data=$(xsel --"$selection"; printf x)
|
||||||
data=${data%x}
|
data=${data%x}
|
||||||
md5=$(md5sum <<< "$data")
|
md5=$(md5sum <<< "$data")
|
||||||
|
@ -13,3 +12,4 @@ while sleep 1; do
|
||||||
|
|
||||||
cat > "$cache_dir/$md5" <<< "$data"
|
cat > "$cache_dir/$md5" <<< "$data"
|
||||||
done
|
done
|
||||||
|
done
|
||||||
|
|
Loading…
Reference in a new issue