check_updates_apt.sh 620 B

12345678910111213141516171819202122
  1. #!/usr/bin/env bash
  2. # apt list --upgradable 2> /dev/null | grep -c unstable &
  3. # updates=$(apt list --upgradable 2> /dev/null | grep -c upgradable);
  4. # updates=$(apt list --upgradable 2> /dev/null | grep -c unstable);
  5. # updates=$(expr $(apt list --upgradable 2> /dev/null | wc -l) - 1)
  6. # updates=$(aptitude search ~U | wc -l)
  7. updates=$(apt-show-versions -u -b | wc -l)
  8. # notify-send -t 3000 "Updates $updates"
  9. if [ "$updates" -gt 0 ]; then
  10. echo " $updates"
  11. # else
  12. # echo " $updates"
  13. # echo ""
  14. fi
  15. case ${BLOCK_BUTTON} in
  16. 1) terminator -e "sudo apt update && sudo apt upgrade && ${SHELL}";;
  17. esac