]> git.armaanb.net Git - charsel.git/blob - charsel
Small changes to improve usability
[charsel.git] / charsel
1 #!/usr/bin/env sh
2
3 # Merge both global and local charfiles
4 cp /usr/share/charsel/* ~/.cache/charsel/
5 cp ~/.local/share/charsel/* ~/.cache/charsel/
6 CHARDIR=~/.cache/charsel
7
8 # Check if user provided a charfile
9 [ -z "$1" ] && echo "No argument supplied"  && exit 1
10
11 # Clear screen
12 clear
13
14 while :
15 do
16   
17   # Put charfile into table
18   column -t $CHARDIR/$1 -N SHORT,CHAR -R SHORT,CHAR --output-separator ' | '
19   read INPUT
20   
21   # Navigate to the right characther
22   OUTPUT=$(grep $INPUT $CHARDIR/$1 | cut -c 3)
23
24   # Clear screen
25   clear
26
27   # Print output, and copy to clipboard
28   echo $OUTPUT
29   echo $OUTPUT | xclip -selection clipboard
30 done