emoji-dmenu: extend for wayland - dotfiles - 🍚 personal arsenal of "rice"
HTML git clone https://git.drkhsh.at/dotfiles.git
DIR Log
DIR Files
DIR Refs
DIR Submodules
DIR README
DIR LICENSE
---
DIR commit df7c908274c7966e806e5ff26bc007c3dbeb147a
DIR parent d395a5333247e12b98c35409e45bead7b55fb089
HTML Author: drkhsh <drkhsh@escpe.net>
Date: Tue, 22 Oct 2024 16:21:54 +0200
emoji-dmenu: extend for wayland
Diffstat:
M bin/bin/emoji-dmenu | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
---
DIR diff --git a/bin/bin/emoji-dmenu b/bin/bin/emoji-dmenu
@@ -1,8 +1,18 @@
#!/bin/sh
# thx to bits from luke smith
+# extended to wayland by drkhsh
-grep -v "#" ${XDG_DATA_HOME}/emoji_list | dmenu -i -l 20 | awk '{print $1}' | tr -d '\n' | xclip -selection clipboard
+menu="dmenu -i -l 20"
+clip="xclip -selection clipboard"
-if [ -n "$(xclip -o -selection clipboard)" ]; then
- notify-send "Emoji copied" "$(xclip -o -selection clipboard) successfully copied!" --icon=dialog-information;
+if [ "$XDG_SESSION_TYPE" == "wayland" ]; then
+ menu="wofi --dmenu"
+ clip="wl-copy"
+fi
+
+emoji="$(grep -v "#" ${XDG_DATA_HOME}/emoji_list | $menu | awk '{print $1}' | tr -d '\n')"
+printf "%s" $emoji | $clip
+
+if [ -n "$emoji" ]; then
+ notify-send "Emoji copied" "$emoji successfully copied!" --icon=dialog-information;
fi