1
0
mirror of https://github.com/gryf/gryf-overlay.git synced 2026-04-05 05:33:32 +02:00
Files
gryf-overlay/x11-misc/rofi-emoji/files/rofi-emoji-3.4.1-primary.patch
gryf db1c26d1d0 Hardmask rofi-emoji 4.x, added latest 3.x version
Version 4.0.0 have compilation issue with undefined MODE_TYPE_SWITCHER:

src/plugin.c:302:13: error: use of undeclared identifier 'MODE_TYPE_SWITCHER'
  302 |     .type = MODE_TYPE_SWITCHER,
2024-10-09 07:32:45 +02:00

50 lines
1000 B
Diff

diff --git a/clipboard-adapter.sh b/clipboard-adapter.sh
index 80f8e6e..12a384a 100755
--- a/clipboard-adapter.sh
+++ b/clipboard-adapter.sh
@@ -53,7 +53,9 @@ main() {
exit 0
;;
copy)
- perform_copy
+ input="$(cat -)"
+ printf "%s" "$input" | perform_copy
+ printf "%s" "$input" | perform_primary
;;
insert)
# Also copy when doing insert to give users a fallback in case automatic
@@ -116,6 +118,33 @@ perform_copy() {
esac
}
+perform_primary() {
+ tool=$(find_copy_tool)
+
+ case "$tool" in
+ xsel)
+ xsel --primary --input
+ ;;
+ xclip)
+ xclip -selection primary -in
+ ;;
+ copyq)
+ copyq copy -
+ ;;
+ wl-copy)
+ wl-copy --primary
+ ;;
+ "")
+ show_error "Could not find any tool to handle copying. Please install a primary handler."
+ exit 1
+ ;;
+ *)
+ show_error "$tool has no implementation for copying into primary yet"
+ exit 2
+ ;;
+ esac
+}
+
perform_insert() {
tool=$(find_insert_tool)