]> git.armaanb.net Git - charsel.git/blob - charsel
changed from .cache directory to /tmp
[charsel.git] / charsel
1 #!/usr/bin/env sh
2
3 # Merge both global and local charfiles
4 CHARDIR=/tmp/charsel
5 cp /usr/share/charsel/* $CHARDIR
6 cp ~/.local/share/charsel/* $CHARDIR
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 -n 1 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   # Copy output to clipboard
28   echo $OUTPUT | xclip -selection clipboard
29 done