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