aboutsummaryrefslogtreecommitdiff
path: root/i3/blocks/packages
blob: 923d47984f2fc77576b47137a66f334967e14a64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/bash

PACKAGES=$(pacman -Qu)

URGENT_VALUE=25

if [[ $? -gt 0 ]]; then
  return
fi

PACKAGE_COUNT=$(echo "${PACKAGES}" | wc -l)

if [[ "${PACKAGE_COUNT}" -gt 0 ]]; then
  echo "${PACKAGE_COUNT}" # full-text
  echo "${PACKAGE_COUNT}" # short-text
  echo ""
  if [[ "${PACKAGE_COUNT}" -gt "${URGENT_VALUE}" ]]; then
    exit 33
  fi
fi