From 17650c88e5d801efa2142c13e2f029d358160245 Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani <3fb650a9-b47e-4604-a282-1dd91953b2ee@anonaddy.me> Date: Wed, 16 Sep 2020 09:33:44 -0400 Subject: [PATCH] It works now! Still need to figuire out the correct directories and makefile for installation --- README.md | 13 ++++++++++++- char.sh | 6 ------ charfiles/latin | 13 +++++++++++++ charsel | 11 +++++++++++ latin.char | 13 ------------- 5 files changed, 36 insertions(+), 20 deletions(-) delete mode 100755 char.sh create mode 100644 charfiles/latin create mode 100755 charsel delete mode 100644 latin.char diff --git a/README.md b/README.md index d46893a..c4bd7c3 100644 --- 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 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 index 0000000..892c5b1 --- /dev/null +++ b/charfiles/latin @@ -0,0 +1,13 @@ +A Ā +E Ē +I Ī +O Ō +U Ū + +a ā +e ē +i ī +o ō +u ū + + diff --git a/charsel b/charsel new file mode 100755 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 index 41b71e0..0000000 --- a/latin.char +++ /dev/null @@ -1,13 +0,0 @@ -A Ā -E Ē -I Ī -O Ō -U Ū - -a ā -e ē -i ī -o ō -u ū - - -- 2.39.2