X-Git-Url: https://git.armaanb.net/?p=charsel.git;a=blobdiff_plain;f=charsel;h=3961cf2f38bd47bd8b9aa3e0f2938fa8591ea270;hp=811372365b78d759b029ecd09fdc229870262246;hb=a0ab9edae51a8ef6e0334691a7b905dbbac87835;hpb=17650c88e5d801efa2142c13e2f029d358160245 diff --git a/charsel b/charsel index 8113723..3961cf2 100755 --- a/charsel +++ b/charsel @@ -1,11 +1,28 @@ #!/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