From: Armaan Bhojwani Date: Sat, 12 Dec 2020 21:49:29 +0000 (-0500) Subject: update readme, fix -n bug, remove branding X-Git-Url: https://git.armaanb.net/?p=charsel.git;a=commitdiff_plain;h=HEAD update readme, fix -n bug, remove branding --- diff --git a/Makefile b/Makefile index 526b314..55eb16c 100644 --- a/Makefile +++ b/Makefile @@ -1,36 +1,27 @@ .DEFAULT_GOAL := install -.RECIPEPREFIX := > install: ->chmod +x ./charsel ->mkdir -p /usr/share/charsel/charfiles/ ->cp charfiles/* /usr/share/charsel/charfiles/ ->cp shell-completions /usr/share/charsel/ ->mkdir /usr/share/doc/charsel ->cp README.md /usr/share/doc/charsel/ ->cp ./charsel /usr/bin/ + chmod +x ./charsel + mkdir -p /usr/share/charsel/charfiles/ + cp charfiles/* /usr/share/charsel/charfiles/ + cp shell-completions /usr/share/charsel/ + mkdir /usr/share/doc/charsel + cp README.md /usr/share/doc/charsel/ + cp ./charsel /usr/bin/ uninstall: ->rm -rf /usr/share/charsel/ ->rm -rf /usr/share/doc/charsel/ ->rm -rf /usr/bin/charsel + rm -rf /usr/share/charsel/ + rm -rf /usr/share/doc/charsel/ + rm -rf /usr/bin/charsel reinstall: ->rm -rf /usr/share/charsel/ ->rm -rf /usr/share/doc/charsel/ ->rm -rf /usr/bin/charsel ->chmod +x ./charsel ->mkdir -p /usr/share/charsel/charfiles/ ->cp charfiles/* /usr/share/charsel/charfiles/ ->cp shell-completions /usr/share/charsel/ ->mkdir /usr/share/doc/charsel ->cp README.md /usr/share/doc/charsel/ ->cp ./charsel /usr/bin/ + make uninstall + make install purge: ->rm -rf ${HOME}/.local/share/charsel/ ->rm -rf ${HOME}/.cache/charsel/ + rm -rf ${HOME}/.local/share/charsel/ + rm -rf ${HOME}/.cache/charsel/ install-completions-bash: ->echo "source /usr/share/charsel/shell-completions" >> '${HOME}/.bashrc' ->echo "autoload bashcompinit ; bashcompinit ; source /usr/share/charsel/shell-completions" >> '${ZDOTDIR}/.zshrc' + echo "source /usr/share/charsel/shell-completions" >> '${HOME}/.bashrc' + echo "autoload bashcompinit ; bashcompinit ; source /usr/share/charsel/shell-completions" >> '${ZDOTDIR}/.zshrc' diff --git a/README.md b/README.md index f0a7f3f..91724a2 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# CHARSEL +# charsel A simple bash script to make copying frequently used special characters to your clipboard easy. It uses a plain-text file known as a "charfile" to define easy to reach shortcuts to special characters ## Installation -- Run `make install` as root to install -- Run `make uninstall` as root to remove. Will not delete your personal charfiles +- Run `make` as root to install +- Run `make uninstall` as root to remove - Run `make purge` to remove charsel files from your home directory - Run `make install-completions` to install the shell completions @@ -13,7 +13,7 @@ It uses a plain-text file known as a "charfile" to define easy to reach shortcut * Bash * Linux * Xclip (using the -n flag bypasses this) - * A terminal with UTF-8 encoding enabled (most desktop environment's default terminal will be fine) + * A terminal with UTF-8 encoding enabled (most default terminals will be fine) ## Usage For argument usage, use `charsel -h` @@ -26,11 +26,10 @@ Some of the default charfiles have hidden shortcuts for capital letters that are Make a new file in `~/.local/share/charsel/charfiles/` or `/usr/share/charsel/charfiles/` with the name that you would like to use to call the charfile in the command. Fill in your shortcodes, using the provided examples in `/usr/share/charsel/charfiles` as a template. There are just 4 rules to follow. - 1. The pattern is "shortcode,output" - 2. Hidden shortcuts go above the line with "---" - 3. Lines can be commented out using a "#" at the start - 4. Shortcodes may not contain ";" (semicolon) as that is used to quit the program - 5. Shortcodes cannot start with - as that confuses grep + 1. The pattern used is "shortcode,output" + 2. Hidden shortcodes go above the line with "---" + 3. Lines can be commented out using a "#" + 4. Shortcodes may not contain a semicolon or a hyphen ## License Copyright Armaan Bhojwani 2020, MIT License, see the LICENSE file for more information diff --git a/branding/logo.png b/branding/logo.png deleted file mode 100644 index 981fdd7..0000000 Binary files a/branding/logo.png and /dev/null differ diff --git a/branding/logo.xcf b/branding/logo.xcf deleted file mode 100644 index 209173d..0000000 Binary files a/branding/logo.xcf and /dev/null differ diff --git a/charfiles/math b/charfiles/math index 8657d38..f6ccd1a 100644 --- a/charfiles/math +++ b/charfiles/math @@ -10,8 +10,6 @@ 2,√ a<,∠ 0,° -`,′ -``,″ 90,⊥ ||,∥ ~=,≅ @@ -19,34 +17,6 @@ t,Δ p,π a,∝ 00,∞ -<<,≪ ->>,≫ s,∑ g,γ -gr,φ -te,⊗ -cr,† -n,⋂ -u,⋃ -su,⊆ -ps,⊂ -ns,⊄ -ss,⊇ -ns,⊅ -sy,⊖ -be,∈ em,Ø -no,¬ -im,⇒ -if,⇔ -fa,∀ -te,∃ -ne,∄ -tf,∴ -bc,∵ -ep,ε -in,∫ -li,∮ -mu,μ - - diff --git a/charsel b/charsel index 56ca812..d9dcb0f 100755 --- a/charsel +++ b/charsel @@ -1,13 +1,11 @@ #!/usr/bin/env bash # Charsel - terminal character selector -# Copyright Armaan Bhojwani 2020, MIT License. See the LICENSE file or -# https://opensource.org/licenses/MIT for more information - -VERSION=2.0.8 +# Copyright Armaan Bhojwani 2020, MIT License # Define argument functions function usage() { echo "Usage: /usr/bin/charsel [OPTION]... [CHARFILE]... + A simple terminal character selector -a include hidden shortcodes -b disable color support @@ -17,8 +15,6 @@ A simple terminal character selector -L show installed charfiles without the message -l show installed charfiles -n dont copy character to clipboard, avoids Xclip dependency - -V check for updates - -v print current version Exit status: 0 okay, @@ -28,17 +24,6 @@ Exit status: 4 other error" } -function version_check(){ - NEW_VERSION=$(curl -s https://codeberg.org/armaan/charsel/raw/branch/master/charsel \ - | grep VERSION= | tail -c +9) - if [[ $VERSION != "$NEW_VERSION" ]]; then - echo "an update is available" - else - echo "you are up to date" - fi - -} - CHARDIR=$HOME/.cache/charsel function list() { ls "$CHARDIR"/charfiles @@ -123,14 +108,6 @@ do n) COPY="no" ;; - v) - echo "charsel" $VERSION - exit 0 - ;; - V) - version_check - exit 0 - ;; ?) echo "Invalid option" usage @@ -145,6 +122,7 @@ if [ $# -eq 0 ]; then charsel -l exit 3 fi + # Redefine charfile and check file validity CHARFILE="$CHARDIR/charfiles/$1" existence @@ -152,7 +130,7 @@ validity # Dependency check if [[ $COPY == "no" ]]; then - if [[ -x /usr/bin/xclip ]]; then + if [[ ! -x /usr/bin/xclip ]]; then echo "Please install xclip." exit 4 fi @@ -169,8 +147,8 @@ clear bold=$(tput bold) normal=$(tput sgr0) -magenta=$(tput setaf 5) -[[ $COLOR == bw ]] && magenta=$(tput setaf 7) +highlight=$(tput setaf 5) +[[ $COLOR == bw ]] && highlight=$(tput setaf 7) white=$(tput setaf 7) @@ -179,7 +157,7 @@ while true do # Format output echo "*---------*---------------*" - echo "| ${bold}${magenta}CHARSEL${white}${normal} |" "$1" + echo "| ${bold}${highlight}CHARSEL${white}${normal} |" "$1" echo "*---------*---------------*" echo ""