summaryrefslogtreecommitdiff
path: root/plugins/bgnotify
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/bgnotify')
-rw-r--r--plugins/bgnotify/README.md2
-rw-r--r--plugins/bgnotify/bgnotify.plugin.zsh5
2 files changed, 6 insertions, 1 deletions
diff --git a/plugins/bgnotify/README.md b/plugins/bgnotify/README.md
index 6bbe3b302..33d529f15 100644
--- a/plugins/bgnotify/README.md
+++ b/plugins/bgnotify/README.md
@@ -35,12 +35,14 @@ Just add bgnotify to your plugins list in your `.zshrc`
One can configure a few things:
+- `bgnotify_bell` enabled or disables the terminal bell (default true)
- `bgnotify_threshold` sets the notification threshold time (default 6 seconds)
- `function bgnotify_formatted` lets you change the notification. You can for instance customize the message and pass in an icon.
Use these by adding a function definition before the your call to source. Example:
```sh
+bgnotify_bell=false ## disable terminal bell
bgnotify_threshold=4 ## set your own notification threshold
function bgnotify_formatted {
diff --git a/plugins/bgnotify/bgnotify.plugin.zsh b/plugins/bgnotify/bgnotify.plugin.zsh
index 4499d816c..3c0766191 100644
--- a/plugins/bgnotify/bgnotify.plugin.zsh
+++ b/plugins/bgnotify/bgnotify.plugin.zsh
@@ -27,7 +27,7 @@ function bgnotify_end {
# check if Terminal app is not active
[[ $(bgnotify_appid) != "$bgnotify_termid" ]] || return
- printf '\a' # beep sound
+ [[ $bgnotify_bell = true ]] && printf '\a' # beep sound
bgnotify_formatted "$exit_status" "$bgnotify_lastcmd" "$elapsed"
} always {
bgnotify_timestamp=0
@@ -136,6 +136,9 @@ function bgnotify {
## Defaults
+# enable terminal bell on notify by default
+bgnotify_bell=${bgnotify_bell:-true}
+
# notify if command took longer than 5s by default
bgnotify_threshold=${bgnotify_threshold:-5}