diff --git a/apt-upgrades/README.md b/apt-upgrades/README.md index 92fe7330..7919d2a3 100644 --- a/apt-upgrades/README.md +++ b/apt-upgrades/README.md @@ -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" ``` diff --git a/apt-upgrades/apt-upgrades b/apt-upgrades/apt-upgrades index 3ca2b5ea..116edcc4 100755 --- a/apt-upgrades/apt-upgrades +++ b/apt-upgrades/apt-upgrades @@ -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