From b5b3c25c28aab915b506d78a4ba23574da1ac977 Mon Sep 17 00:00:00 2001 From: foo-dogsquared Date: Mon, 20 Jan 2020 17:18:40 +0800 Subject: [PATCH] Create a emoji selection script --- bin/choose-emoji | 13 +++++++++++++ sxhkd/sxhkdrc | 5 ++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 bin/choose-emoji diff --git a/bin/choose-emoji b/bin/choose-emoji new file mode 100644 index 0000000..a77a9cf --- /dev/null +++ b/bin/choose-emoji @@ -0,0 +1,13 @@ +#!/usr/bin/env sh + +# Downloads the official emoji list from http://www.unicode.org/Public/emoji/latest/emoji-test.txt and create a selection to clipboard with rofi. + +# Dependencies: +# * mktemp - GNU coreutils 8.31 +# * wget - GNU Wget 1.20.3 built on linux-gnu +# * sed - GNU sed 4.8 +# * awk - GNU Awk 5.0.1 +# * rofi - Version: 1.5.4 +# * xclip - version 0.13 + +awk 'match($0, /([0-9A-F ]+)\s+; fully-qualified\s+# (\S+) E[[:digit:]]+.[[:digit:]]+ (.+)$/, a){print a[2], a[3]}' ~/.local/share/emoji-test.txt | rofi -dmenu -p "Choose an emoji to copy." -theme fds-sidebar-dark | awk '{print $1}' | xclip -selection clipboard && notify-send "'$(xclip -o -selection clipboard)' has been copied to clipboard." diff --git a/sxhkd/sxhkdrc b/sxhkd/sxhkdrc index 64e7679..a97e6db 100644 --- a/sxhkd/sxhkdrc +++ b/sxhkd/sxhkdrc @@ -52,7 +52,10 @@ super + shift + d $HOME/bin/rofi-user-action-menu.sh super + shift + m - man -k . | rofi -dmenu -p "Select the manual entry" -theme fds-sidebar-dark | awk '{print $1}' | xargs -r man + ~/bin/choose-manual --viewpdf + +super + shift + e + ~/bin/choose-emoji # Reloads the Simple X Hotkey Daemon config and Polybar. shift + super + r