aboutsummaryrefslogtreecommitdiff
path: root/scripts/.local/bin/personal/bar/updates
blob: c0a3f4a4673b9f72293fcdbc4e4fa9efa0ecdd8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/dash

storage=0

if [ "$1" = "read" ]; then
  if [ "$storage" != "0" ]; then
    echo "$storage" 
  else
    echo ""
  fi
elif [ "$1" = "run" ]; then
  sudo pacman -Syu && updates check
elif [ "$1" = "check" ]; then
  packages="$(checkupdates | wc -l)"
  sed -i "s/storage=$storage/storage=$packages/g" "$0"
fi