From ef6134e9d2ee14d866606fcff4017c4b98bc974a Mon Sep 17 00:00:00 2001 From: MeaTLoTioN Date: Tue, 31 Oct 2023 14:49:11 +0000 Subject: [PATCH] Fix up dmenuunicode and make a working rofi equivalent --- dmenuunicode | 4 ++-- rofiunicode | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100755 rofiunicode diff --git a/dmenuunicode b/dmenuunicode index 4d669b5..9296a8a 100755 --- a/dmenuunicode +++ b/dmenuunicode @@ -1,9 +1,9 @@ -#!/bin/sh +#!/bin/bash # Give dmenu list of all unicode characters to copy. # Shows the selected character in dunst if running. # Must have xclip installed to even show menu. -xclip -h >/dev/null || exit +xclip -h >/dev/null 2>&1 || exit emojifile="emojis.txt" diff --git a/rofiunicode b/rofiunicode new file mode 100755 index 0000000..9b4e7ab --- /dev/null +++ b/rofiunicode @@ -0,0 +1,20 @@ +#!/bin/bash +# Give rofi list of all unicode characters to copy. +# Shows the selected character in dunst if running. + +# Must have xclip installed to even show menu. +xclip -h >/dev/null 2>&1 || exit + +emojifile="emojis.txt" + +chosen=$(grep -v "#" $emojifile | rofi -dmenu -i -l 20 -fn 'Noto Color Emoji Mono-18') + +[ "$chosen" != "" ] || exit + +c=$(echo "$chosen" | sed "s/ .*//") +echo "$c" | tr -d '\n' | xclip -selection clipboard +notify-send "'$c' copied to clipboard." & + +s=$(echo "$chosen" | sed "s/.*; //" | awk '{print $1}') +echo "$s" | tr -d '\n' | xclip +notify-send "'$s' copied to primary." &