parent
c40456caa0
commit
2cbfb4ef88
4
clipmenu
4
clipmenu
|
@ -22,5 +22,9 @@ chosen_line=$(printf '%s\n' "${!selections[@]}" | dmenu -l "$dmenu_lines" "$@")
|
||||||
[[ $chosen_line ]] || exit 1
|
[[ $chosen_line ]] || exit 1
|
||||||
|
|
||||||
for selection in clipboard primary; do
|
for selection in clipboard primary; do
|
||||||
|
if type -p xsel >/dev/null 2>&1; then
|
||||||
xsel --"$selection" < "${selections[$chosen_line]}"
|
xsel --"$selection" < "${selections[$chosen_line]}"
|
||||||
|
else
|
||||||
|
xclip -sel "$selection" < "${selections[$chosen_line]}"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
@ -7,7 +7,12 @@ declare -A last_data
|
||||||
|
|
||||||
while sleep 1; do
|
while sleep 1; do
|
||||||
for selection in clipboard primary; do
|
for selection in clipboard primary; do
|
||||||
|
if type -p xsel >/dev/null 2>&1; then
|
||||||
data=$(xsel --"$selection"; printf x)
|
data=$(xsel --"$selection"; printf x)
|
||||||
|
else
|
||||||
|
data=$(xclip -o -sel "$selection"; printf x)
|
||||||
|
fi
|
||||||
|
|
||||||
data=${data%x}
|
data=${data%x}
|
||||||
|
|
||||||
[[ $data ]] || continue
|
[[ $data ]] || continue
|
||||||
|
|
Loading…
Reference in a new issue