From 79b229bb6b135dcf4b4febc5d92e6329af18d1bb Mon Sep 17 00:00:00 2001 From: gryf Date: Tue, 26 Oct 2021 20:32:32 +0200 Subject: [PATCH] Added rofi-emoji plugin --- x11-misc/rofi-emoji/Manifest | 3 ++ .../files/rofi-emoji-2.2.0-primary.patch | 36 +++++++++++++++++++ x11-misc/rofi-emoji/rofi-emoji-2.2.0.ebuild | 35 ++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 x11-misc/rofi-emoji/Manifest create mode 100644 x11-misc/rofi-emoji/files/rofi-emoji-2.2.0-primary.patch create mode 100644 x11-misc/rofi-emoji/rofi-emoji-2.2.0.ebuild diff --git a/x11-misc/rofi-emoji/Manifest b/x11-misc/rofi-emoji/Manifest new file mode 100644 index 0000000..4ac3e6f --- /dev/null +++ b/x11-misc/rofi-emoji/Manifest @@ -0,0 +1,3 @@ +AUX rofi-emoji-2.2.0-only-primary.patch 859 BLAKE2B 67c339a676dc0f6138702f06dbc32060bfc497b0d103b2bbcf56ae62fca10500a20be54e469ca9e20eee9bea5b7ce5b8d3e11f717592ea79949dc935d8f09458 SHA512 a13344522ffd822ac21f57f3d48dc1a42ea92783ac9cf9f678cc8a02f55f0412bd75c46d91e391980dfd58f9c5dd74fc02a7901427f544d1e7d707da08b12691 +AUX rofi-emoji-2.2.0-primary.patch 855 BLAKE2B 87a2985f1ad5f34a9af98589697c732443181527bd221001ecd475c02bd2b8c81938a8a13fafc41356424fefea5f0daec7077422d40cce58402ca2824e73fb72 SHA512 9a2ca5508e3f010966cfa5652849169ba805bd09c503915b16fa5b0e7c4d76932322014be3d28f16548cbad8ef10d3ae51fe9cdd0e03ff5becda1067d96d4adf +EBUILD rofi-emoji-2.2.0.ebuild 772 BLAKE2B 1278a7dde4af384bf8cd541b1582b6b13c78fee0e6ec6f6e633e62bc94b28e283b97e0d7b3c46cba2a6f0d19edb3b547e80907c5c8809809e5595dee60c14673 SHA512 4b2c4ff3d8d82a13b0ec9c8937ce7a34ddb83a30d86954ffd13987c2a32295c90b76af8bfaf81d278597d8eb67de5c0f483a29fefe22c9eb606a32e9098187dc diff --git a/x11-misc/rofi-emoji/files/rofi-emoji-2.2.0-primary.patch b/x11-misc/rofi-emoji/files/rofi-emoji-2.2.0-primary.patch new file mode 100644 index 0000000..8d6cd53 --- /dev/null +++ b/x11-misc/rofi-emoji/files/rofi-emoji-2.2.0-primary.patch @@ -0,0 +1,36 @@ +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\"" diff --git a/x11-misc/rofi-emoji/rofi-emoji-2.2.0.ebuild b/x11-misc/rofi-emoji/rofi-emoji-2.2.0.ebuild new file mode 100644 index 0000000..1dc4df5 --- /dev/null +++ b/x11-misc/rofi-emoji/rofi-emoji-2.2.0.ebuild @@ -0,0 +1,35 @@ +# Copyright 2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 +inherit autotools git-r3 + +DESCRIPTION="Emoji selector plugin for Rofi " +HOMEPAGE="https://github.com/Mange/rofi-emoji" +EGIT_REPO_URI="https://github.com/Mange/rofi-emoji" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="+clipboard primary wayland +X" + +DEPEND="x11-misc/rofi" +RDEPEND="${DEPEND} + X? ( || ( x11-misc/xsel x11-misc/xclip ) ) + wayland? ( gui-apps/wl-clipboard )" +BDEPEND="" + +PATCHES=( + "${FILESDIR}"/${P}-primary.patch +) + +src_prepare() { + default + if ! use primary; then + sed -ie '/handle_primary "$tool"/d' clipboard-adapter.sh || die + fi + if ! use clipboard; then + sed -ie '/handle_copy "$tool"/d' clipboard-adapter.sh || die + fi + eautoreconf +}