From 5f67fe6753fa7918d2e92aed3f3f82405eae4674 Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani <3fb650a9-b47e-4604-a282-1dd91953b2ee@anonaddy.me> Date: Fri, 16 Oct 2020 19:18:22 -0400 Subject: [PATCH] added comment support to charfile, beutification --- README.md | 2 +- TODO.md | 2 -- charsel | 9 ++++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 451ecc1..0040ba7 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ The default charfiles all have hidden shortcuts for capital letters that are not ## Creating a charfile Make a new file in `~/.local/share/charsel/` or `/usr/share/charsel` with the name that you would like to use to call the charfile in the command. -Fill it in, using the provided examples as a template. Hidden shortcuts go above the '---' +Fill it in, using the provided examples as a template. Hidden shortcuts go above the '---', lines can be commented out using a '#' at the start of the line ## License Charfile is GNU GPLv3 licensed, see COPYING for more information diff --git a/TODO.md b/TODO.md index ec2a980..f07b912 100644 --- a/TODO.md +++ b/TODO.md @@ -1,4 +1,2 @@ -- Create a simple gtk interface using Zenity - "Smart" shortcode length detection -- Add comment support to charfiles - Add purge option to makefile diff --git a/charsel b/charsel index 077b10f..a8b5e66 100755 --- a/charsel +++ b/charsel @@ -50,12 +50,19 @@ clear # Main program while : do - # Format charfile into table, showing only the shortcuts below the divider in the charfile + # Format output + echo "*---------*---------------*" + echo "| CHARSEL | " $1 + echo "*---------*---------------*" + echo "" + cat $CHARFILE \ + | sed -e '/^[ \t]*#/d' \ | grep -A 100 - \ | tail -n +2 \ | column -t -N input,output --output-separator ' | ' --separator ',' + echo "" echo "*-------------------------*" echo "| previous shorcode:" $INPUT echo "| previous output: " $OUTPUT -- 2.39.2