1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#!/bin/sh
# title="🇺 Unicode input"
PATH=/home/zachariahdecook/.local/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:~/.local/bin:~/.composer/vendor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
makefile() {
mkdir -p ~/.cache/sxmo/
cat /usr/share/unicode/UnicodeData.txt | grep -v '<control>' | grep -v '0020;SPACE' | busybox awk -F';' '
function hex2dec(h,i,x,v){
h=tolower(h);sub(/^0x/,"",h)
for(i=1;i<=length(h);++i){
x=index("0123456789abcdef",substr(h,i,1))
if(!x)return"NaN"
v=(16*v)+x-1
}
return v
}
(1){
n = hex2dec($1);
# UTF-8 Implementation (because "%lc" no worky in POSIX awk)
if (n < 128) {
printf("%c", n);
} else if (n < 2048) {
printf("%c%c", 192 + (n/64), 128 + n%64);
} else if (n <= 0xFFFF) {
printf("%c%c%c", 224 + (n/4096)%16,128 + (n/64)%64, 128 + n%64);
} else {
printf("%c%c%c%c", 240 + (n/262144), 128 + (n/4096)%64, 128 + (n/64)%64, 128 + n%64)
}
printf(" %s %s\n", $2, $11);
}' > ~/.cache/sxmo/PrintableUnicodes.tsv
}
test -e ~/.cache/sxmo/PrintableUnicodes.tsv || makefile
# can't wl-ime-type or wtype in pop-os wayland
cat ~/.cache/sxmo/PrintableUnicodes.tsv | sxmo_dmenu.sh -i | cut -d' ' -f1 | tee /dev/stderr | xargs wl-copy #xargs -I{} wl-ime-type '{}'
|