summaryrefslogtreecommitdiff
path: root/.local/bin/uni
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-12-06 20:58:18 +0100
committerThomas Voss <mail@thomasvoss.com> 2023-12-06 20:58:47 +0100
commitdb7321af115a79b63267cb18889cbd334e8ca6e2 (patch)
treeec388295051ebc1f3d79bd3baf79b7f12f076cda /.local/bin/uni
parentf2fde1570a04a654e2ed0c165d56feb29ddb25bf (diff)
scripts: Move many a script from sh to andy
Diffstat (limited to '.local/bin/uni')
-rwxr-xr-x.local/bin/uni13
1 files changed, 5 insertions, 8 deletions
diff --git a/.local/bin/uni b/.local/bin/uni
index a45b4c5..a882c8c 100755
--- a/.local/bin/uni
+++ b/.local/bin/uni
@@ -1,11 +1,11 @@
#!/usr/local/bin/andy
-set -e NOTIFY_LONG unicode
-set -e NOTIFY_SHORT uni
+set -e NOTIFY_LONG unicode
+set -e NOTIFY_SHORT `basename $args[0]
func setup {
curl 'https://www.unicode.org/Public/UNIDATA/UnicodeData.txt'
- | sed -E r#'
+ | sed -E '
s/;[^;]*//2g
s/\<(.)([A-Z]*)/\1\L\2/2g
/^[^;]*;</d
@@ -13,11 +13,10 @@ func setup {
/Variation Selector/d
s/[^;]*/\\u&/
s/^\\u([^;]{5})/\\U000\1/
- '# >$DATA
+ ' >$DATA
}
-test $#XDG_DATA_HOME -gt 0 || set XDG_DATA_HOME $HOME/.local/share
-set DATA $XDG_DATA_HOME/unicode-data
+set DATA $(XDG_DATA_HOME:$HOME/.local/share)/unicode-data
test -f $DATA || setup
set i `{
@@ -33,5 +32,3 @@ if test -t 2 {
} else {
wtype -- $rune
}
-
-# vi: ft=sh