personal dotfiles: my Hyprland config
Diffstat (limited to '.local/bin/unicode.sh')
-rwxr-xr-x.local/bin/unicode.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/.local/bin/unicode.sh b/.local/bin/unicode.sh
new file mode 100755
index 0000000..b0de965
--- /dev/null
+++ b/.local/bin/unicode.sh
@@ -0,0 +1,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 '{}'
+