Merge 058711a793
into 1f64cb6544
This commit is contained in:
commit
47d352cb63
2 changed files with 21 additions and 2 deletions
12
README.rst
12
README.rst
|
@ -129,6 +129,18 @@ NOTE: This configuration option currently only works for Linux.
|
|||
# Set notification expiry to 10 seconds
|
||||
export AUTO_NOTIFY_EXPIRE_TIME=10000
|
||||
|
||||
|
||||
**Notification Urgency Level**
|
||||
|
||||
By default non zero exit codes lead to notifications marked as critical.
|
||||
On some systems (e.g. KDE) critical notifications are not desirable as they will never expire.
|
||||
You can override notification urgency by setting the environment variable ``"AUTO_NOTIFY_URGENCY"`` to ``low``, ``normal``, or ``critical``.
|
||||
NOTE: This configuration option currently only works for Linux.
|
||||
|
||||
::
|
||||
|
||||
# Force all notifications to have normal urgency
|
||||
export AUTO_NOTIFY_URGENCY="normal"
|
||||
|
||||
**Ignored Commands**
|
||||
|
||||
|
|
|
@ -23,6 +23,9 @@ export AUTO_NOTIFY_VERSION="0.8.0"
|
|||
'nano'
|
||||
)
|
||||
|
||||
# Override notification urgency
|
||||
# export AUTO_NOTIFY_URGENCY="normal"
|
||||
|
||||
function _auto_notify_format() {
|
||||
local MESSAGE="$1"
|
||||
local command="$2"
|
||||
|
@ -51,8 +54,12 @@ function _auto_notify_message() {
|
|||
|
||||
if [[ "$platform" == "Linux" ]]; then
|
||||
local urgency="normal"
|
||||
if [[ "$exit_code" != "0" ]]; then
|
||||
urgency="critical"
|
||||
if [[ -z $AUTO_NOTIFY_URGENCY ]]; then
|
||||
if [[ "$exit_code" != "0" ]]; then
|
||||
urgency="critical"
|
||||
fi
|
||||
else
|
||||
urgency=$AUTO_NOTIFY_URGENCY
|
||||
fi
|
||||
notify-send "$title" "$body" --app-name=zsh "--urgency=$urgency" "--expire-time=$AUTO_NOTIFY_EXPIRE_TIME"
|
||||
elif [[ "$platform" == "Darwin" ]]; then
|
||||
|
|
Loading…
Add table
Reference in a new issue