]> git.armaanb.net Git - charsel.git/commitdiff
It works now! Still need to figuire out the correct directories and makefile for...
authorArmaan Bhojwani <3fb650a9-b47e-4604-a282-1dd91953b2ee@anonaddy.me>
Wed, 16 Sep 2020 13:33:44 +0000 (09:33 -0400)
committerArmaan Bhojwani <3fb650a9-b47e-4604-a282-1dd91953b2ee@anonaddy.me>
Wed, 16 Sep 2020 13:33:44 +0000 (09:33 -0400)
README.md
char.sh [deleted file]
charfiles/latin [new file with mode: 0644]
charsel [new file with mode: 0755]
latin.char [deleted file]

index d46893a61760fa48c9360d2e4e71582d8ffee944..c4bd7c3842b81d8c4c95e4a5eab84b1e74be848a 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1 +1,12 @@
-A command line tool using xclip to copy special charachters. UTF-8 encoding required
+# charsel
+A very simple comand line tool to make a shortcut to a special characther. 
+It takes the input of a .char file, then puts it into a table and waits for your input. Once you put in your shortcut key, it prints the special character then copies it to the clipboard.
+A .char file is just two columns with the shortcut on the left, then a separator, then the special charachter to be copied.
+
+## DEPENDENCIES
+posix shell
+util-linux
+xclip
+
+## USAGE
+charselect.sh $charfile
diff --git a/char.sh b/char.sh
deleted file mode 100755 (executable)
index 864f90d..0000000
--- a/char.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/env sh
-
-column -t latin.char -N SHORT,CHAR -R SHORT,CHAR --output-separator '    |    '
-read input
-
-awk '{print $2}' latin.char
diff --git a/charfiles/latin b/charfiles/latin
new file mode 100644 (file)
index 0000000..892c5b1
--- /dev/null
@@ -0,0 +1,13 @@
+A Ā
+E Ē
+I Ī
+O Ō
+U Ū
+
+a ā
+e ē
+i ī
+o ō
+u ū
+
+
diff --git a/charsel b/charsel
new file mode 100755 (executable)
index 0000000..8113723
--- /dev/null
+++ b/charsel
@@ -0,0 +1,11 @@
+#!/usr/bin/env sh
+
+CHARDIR=~/.local/share/charsel
+
+column -t $CHARDIR/$1 -N SHORT,CHAR -R SHORT,CHAR --output-separator '    |    '
+read INPUT
+
+OUTPUT=$(grep $INPUT $CHARDIR/$1 | cut -c 3)
+
+echo $OUTPUT
+echo $OUTPUT | xclip -selection clipboard
diff --git a/latin.char b/latin.char
deleted file mode 100644 (file)
index 41b71e0..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-A    Ā
-E    Ē
-I    Ī
-O    Ō
-U    Ū
-
-a    ā
-e    ē
-i    ī
-o    ō
-u    ū
-
-