X-Git-Url: https://git.danix.xyz/?p=my-dotfiles.git;a=blobdiff_plain;f=bin%2Fslack-updates;fp=bin%2Fslack-updates;h=65e7728b08f1b845374f1c7488aa90319e8d6d96;hp=0000000000000000000000000000000000000000;hb=252ef34a643a6cef28227c60b35d1fb942e5412e;hpb=7abef725078fc52196b630c95f354fb58864c743 diff --git a/bin/slack-updates b/bin/slack-updates new file mode 100644 index 0000000..65e7728 --- /dev/null +++ b/bin/slack-updates @@ -0,0 +1,35 @@ +#!/bin/bash +CL="https://mirrors.slackware.com/slackware/slackware64-current/ChangeLog.txt" +LOCAL_CL="/var/lib/slackpkg/ChangeLog.txt" +TMP="/tmp" +TMPCL="${TMP}/ChangeLog.txt" + + +function SHOW_TOOLTIP () { + sed '/+--------------------------+/Q' $TMPCL |qarma --width=600 --height=400 --text-info +} + + +if [[ -f ${TMPCL} ]]; then + rm $TMPCL +fi + wget -q -P ${TMP} ${CL} + if [ $? -ne 0 ]; then + echo " 󱧖  " + fi +NCL=$(head -n 1 ${TMPCL}) +LCL=$(head -n 1 ${LOCAL_CL}) + +if [[ ${NCL} != ${LCL} ]];then + echo " 󰏗 󰚰 " +else + echo " 󰏗  " +fi + +if [ $1 ]; then + case $1 in + -n ) + SHOW_TOOLTIP + ;; + esac +fi