X-Git-Url: https://git.armaanb.net/?p=charsel.git;a=blobdiff_plain;f=charsel;fp=charsel;h=d9dcb0f9b2a298c6e123f13bce0d8eba530c4c88;hp=56ca812294d41d18d8e0e00cf776dc2283211a40;hb=11c92905165c2b140143d27791c160f8727417e1;hpb=983fe3a83791de6f8df163b936c912487c81be43 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 ""