~ecs/dotfiles

6b0533c969877a291bd0b67d8ad9b492f5ebffa0 — Ember Sawady 3 months ago 4f0f386
fix unicode input stuff

whoa i was not good at awk back in 2021
2 files changed, 16 insertions(+), 3 deletions(-)

A bin/unitype
M etc/sway/config
A bin/unitype => bin/unitype +13 -0
@@ 0,0 1,13 @@
#!/bin/sh -eu

case "$1" in
search)
	opts="$(menu -p 'search ' </dev/null | uni -r -q search | cut -d\' -f2)"
	printf %s "$opts" | menu | head -n1 | tr -d '\n' | wtype - ;;
codepoint)
	menu -p 'codepoint ' </dev/null | uni -r -q print |
		awk -F\' '{ printf "%s", $2; exit }' | wtype - ;;
emoji)
	menu -p 'emoji ' </dev/null | uni -r -q emoji |
		awk '{ printf $1; exit }' | wtype - ;;
esac

M etc/sway/config => etc/sway/config +3 -3
@@ 132,9 132,9 @@ bindsym $mod+Shift+c exec "cp-totp"
bindsym $mod+y exec "upload-menu"
bindsym $mod+Shift+y exec cpvi
bindsym $mod+p exec cpvi -p
bindsym $mod+u exec menu -p 'search ' </dev/null | uni -r -q sprintearch | cut -d\\' -f2 | menu | tr -d '\n' | head -n1 | wtype -
bindsym $mod+Shift+u exec menu -p 'codepoint ' </dev/null | uni -r -q print | cut -d\\' -f2 | tr -d '\n' | head -n1 | wtype -
bindsym $mod+Shift+e exec menu -p 'emoji ' </dev/null | uni -r -q emoji | awk '{ print $1 }' | tr -d '\n' | head -n1 | wtype -
bindsym $mod+u exec unitype search
bindsym $mod+Shift+u exec unitype codepoint
bindsym $mod+Shift+e exec unitype emoji

bindsym XF86AudioRaiseVolume exec vol up 5
bindsym XF86AudioLowerVolume exec vol down 5