i3-wm/.config/conky/scripts/checkUpdates.sh

27 lines
588 B
Bash
Raw Normal View History

2025-08-05 01:22:52 +02:00
#!/bin/bash
2025-08-09 18:48:15 +02:00
# Variables
listupdates_file=/tmp/listupdates
listupdates_show=/tmp/listupdates_show
# listupdates file init
if [ ! -f ${listupdates_file} ] ; then
touch ${listupdates_file}
echo "0" > ${listupdates_file}
fi
if [ ! -f ${listupdates_show} ] ; then
touch ${listupdates_show}
echo "0" > ${listupdates_show}
fi
2025-08-05 01:22:52 +02:00
# Check updates on Arch Linux
if [ -f /usr/bin/pacman ] ; then
2025-08-09 18:48:15 +02:00
echo "$(cat ${listupdates_show}) "
2025-08-05 01:22:52 +02:00
# Check updates on Ubuntu/Debian/Devuan
elif [ -f /usr/bin/apt ] ; then
2025-08-09 18:48:15 +02:00
echo "$(cat ${listupdates_show}) "
2025-08-05 01:22:52 +02:00
# Disable for other distros
else
2025-08-08 12:47:26 +02:00
echo "0 "
2025-08-05 01:22:52 +02:00
fi