--- /dev/null
+#!/bin/env sh
+
+if [ `whoami` == root ]; then
+ mkdir -p /usr/share/charsel
+ cp charfiles/* /usr/share/charsel/
+ chmod +x charsel
+ cp charsel /usr/bin/
+ exit
+else
+ mkdir -p ~/.local/share/charsel
+ cp charfiles/* ~/.local/share/charsel/
+ chmod +x charsel
+ cp charsel ~/.local/bin/
+ exit
+fi
# 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.
+
+It takes the input of a charfile, 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 charfile is just two columns with the shortcut on the left, then a separator, then the special charachter to be copied.
+
+## INSTALLATION
+Run the INSTALL.sh script
+If run as root, it will be installed globally, if run without root, it will be just instaled for the local user
## DEPENDENCIES
posix shell
xclip
## USAGE
-charselect.sh $charfile
+charsel <charfile>
+
+## CREATING A CHARFILE
+Make a new file in ~/.local/share/charsel/ with the name that you want to use to call the file in the command
+Fill it in, using the provided example as a template.
#!/usr/bin/env sh
-CHARDIR=~/.local/share/charsel
+# Merge both global and local charfiles
+mkdir ~/.cache/charsel/ &
+cp /usr/share/charsel/* ~/.cache/charsel/
+cp ~/.local/share/charsel/* ~/.cache/charsel/
+CHARDIR=~/.cache/charsel
-column -t $CHARDIR/$1 -N SHORT,CHAR -R SHORT,CHAR --output-separator ' | '
-read INPUT
+# clear screen
+clear
-OUTPUT=$(grep $INPUT $CHARDIR/$1 | cut -c 3)
+while :
+do
+
+ # Put charfile into table
+ column -t $CHARDIR/$1 -N SHORT,CHAR -R SHORT,CHAR --output-separator ' | '
+ read INPUT
+
+ # Navigate to the right characther
+ OUTPUT=$(grep $INPUT $CHARDIR/$1 | cut -c 3)
-echo $OUTPUT
-echo $OUTPUT | xclip -selection clipboard
+ # Clear screen
+ clear
+
+ # Print output, and copy to clipboard
+ echo $OUTPUT
+ echo $OUTPUT | xclip -selection clipboard
+done