1
0
mirror of https://github.com/gryf/gryf-overlay.git synced 2026-03-12 22:15:50 +01:00
Files
gryf-overlay/x11-misc/rofi-emoji/files/rofi-emoji-2.2.0-primary.patch
2021-10-26 20:32:32 +02:00

37 lines
855 B
Diff

diff --git a/clipboard-adapter.sh b/clipboard-adapter.sh
index 891c65d..ff8501c 100755
--- a/clipboard-adapter.sh
+++ b/clipboard-adapter.sh
@@ -52,6 +52,23 @@ handle_copy() {
esac
}
+handle_primary() {
+ case "$1" in
+ xsel)
+ xsel --primary --input
+ ;;
+ xclip)
+ xclip -selection primary -in
+ ;;
+ wl-copy)
+ wl-copy --primary
+ ;;
+ *)
+ show_error "$1 has no implementation for copying yet"
+ exit 1
+ esac
+}
+
# Print out the first argument and return true if that argument is an installed
# command. Prints nothing and returns false if the argument is not an installed
# command.
@@ -86,6 +103,7 @@ case "$1" in
copy)
shift
printf "%s" "$*" | handle_copy "$tool"
+ printf "%s" "$*" | handle_primary "$tool"
;;
*)
show_error "$0: Unknown command \"$1\""