Skip to content

Commit

Permalink
apt-upgrades: use injected properties
Browse files Browse the repository at this point in the history
See: #132
  • Loading branch information
kb100 committed Jan 17, 2018
1 parent 72e7afe commit 2ee3a11
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
23 changes: 12 additions & 11 deletions apt-upgrades/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,16 @@ Instead of using `signal=1` in the configuration, you can use `interval=3600`
to have the script execute every hour.
This method avoids the usage of apt/dpkg hooks.

# Options

```
Usage: apt-upgrades [-s pending_symbol] [-o] [-c pending_color] [-N|-n nonpending_color] [-h]
Options:
-s Specify a refresh symbol. Default: "\uf021 "
-o Show refresh symbol only, but no numbers.
-c Color when upgrade is pending. Default: #00FF00
-n Color when no upgrade is pending. Default: #FFFFFF
-N Only display text if upgrade is pending (supercedes -n)
-h Show this help text
# Config

```INI
[apt-upgrades]
command=$SCRIPT_DIR/apt-upgrades
signal=1
interval=once
#PENDING_SYMBOL="\uf021 "
#SYMBOL_ONLY=0
#ALWAYS_PRINT=1
#PENDING_COLOR="#00FF00"
#NONPENDING_COLOR="#FFFFFF"
```
10 changes: 5 additions & 5 deletions apt-upgrades/apt-upgrades
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
# i3blocks blocklet script to display pending system upgrades

# FontAwesome refresh symbol, change if you do not want to install FontAwesome
PENDING_SYMBOL="\uf021 "
PENDING_SYMBOL=${PENDING_SYMBOL:-"\uf021 "}

# By default, show both the symbol and the numbers
SYMBOL_ONLY=0
SYMBOL_ONLY=${SYMBOL_ONLY:-0}

# By default, show something when no upgrades are pending
ALWAYS_PRINT=1
ALWAYS_PRINT=${ALWAYS_PRINT:-1}

# Colors for when there is/isn't a pending upgrade
PENDING_COLOR="#00FF00"
NONPENDING_COLOR="#FFFFFF"
PENDING_COLOR=${PENDING_COLOR:-"#00FF00"}
NONPENDING_COLOR=${NONPENDING_COLOR:-"#FFFFFF"}

while getopts s:oc:n:Nh opt; do
case "$opt" in
Expand Down

0 comments on commit 2ee3a11

Please sign in to comment.