~yerinalexey/dotfiles

801498b6d06f8976c0a9888346325f21136f1123 — Alexey Yerin 4 months ago 3f119fc
{digraph,emoji}-menu: use wtype
3 files changed, 19 insertions(+), 5 deletions(-)

M river/init
M scripts/digraph-menu
M scripts/emoji-menu
M river/init => river/init +4 -2
@@ 60,10 60,12 @@ riverctl map normal $mod+Shift bracketright spawn 'update-volume up'
riverctl map normal $mod+Shift bracketleft  spawn 'update-volume down'

# Useful symbols
riverctl map normal $mod N spawn digraph-menu
riverctl map normal $mod N spawn 'digraph-menu type'
riverctl map normal $mod+Shift N spawn 'digraph-menu copy'

# Emoji
riverctl map normal $mod M spawn emoji-menu
riverctl map normal $mod M spawn 'emoji-menu type'
riverctl map normal $mod+Shift M spawn 'emoji-menu copy'

# Copy password
riverctl map normal $mod apostrophe spawn pass-menu

M scripts/digraph-menu => scripts/digraph-menu +7 -1
@@ 1,4 1,10 @@
#!/bin/sh

graph="$(vis-digraph | bemenu -p "digraph>" -l 30 | awk '{ print $2 }')"
wl-copy "$graph"
if [ "$1" = "copy" ]; then
	wl-copy "$graph"
elif [ "$1" = "type" ]; then
	wtype -- "$graph"
else
	printf "Unsupported operation\n" >&2
fi

M scripts/emoji-menu => scripts/emoji-menu +8 -2
@@ 20,5 20,11 @@ grep -F "$choice" "$EMOJI_FILE"
emoji="$(printf "%s" "$choice" | awk '{ print $1 }')"
code="$(printf "%s" "$choice" | awk -F'; ' '{ print $2 }')"

wl-copy "$emoji"
wl-copy -p "$code"
if [ "$1" = "copy" ]; then
	wl-copy "$emoji"
	wl-copy -p "$code"
elif [ "$1" = "type" ]; then
	wtype -- "$emoji"
else
	printf "Unsupported operation\n" >&2
fi