########################################################################
-VERSION=2.0.7
+VERSION=2.0.8
# Define argument functions
function usage() {
-L show installed charfiles without the message
-l show installed charfiles
-n dont copy character to clipboard, avoids Xclip dependency
- -v print version
+ -V check for updates
+ -v print current version
Exit status:
0 okay,
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
}
# Look for arguments
-while getopts ":abcdhlLnv" arg
+while getopts ":abcdhlLnvV" arg
do
case ${arg} in
a)
echo "charsel" $VERSION
exit 0
;;
+ V)
+ version_check
+ exit 0
+ ;;
?)
echo "Invalid option"
usage