2 # Merge both global and local charfiles
4 cp -R /usr/share/charsel/* $CHARDIR/
5 cp -R ~/.local/share/* $CHARDIR/
10 # Check if user provided an input
11 [ -z "$1" ] && echo "No argument supplied" && exit
13 if [ $1 = "list" ]; then
14 echo "The following charfiles are installed"
20 CHARFILE=$CHARDIR/charfiles/$1
22 # Define length of shortcut
23 LENGTH=$(cat $CHARFILE | cut -f 1 -d ',' -s | wc -L | cut -b 1)
31 # Put charfile into table, showing only the shortcuts below the divider in the charfile
32 cat $CHARFILE | grep -A 100 - | tail -n +2 | column -t --output-separator ' | ' --separator ','
34 # Automatically enter input
37 # Navigate to the right characther
38 OUTPUT=$(grep $INPUT $CHARFILE | cut -f 2 -d ',' -s)
43 # Copy output to clipboard
44 echo $OUTPUT | xclip -selection clipboard