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

storage=29

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