mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-19 20:29:45 +01:00
1308515d1c
This patch will re-order the if statements when checking what operating system the user is running. This is useful for people that already have a `notify-send` binary in their $PATH but are running OSX. An example of such requirements is anyone running `vagrant-notify` is required to have a `notify-send` binary on their $PATH. See [link](https://github.com/fgrehm/vagrant-notify#os-x). |
||
---|---|---|
.. | ||
bgnotify.plugin.zsh | ||
README.md |
bgnotify zsh plugin
cross-platform background notifications for long running commands! Supports OSX and Ubuntu linux.
Standalone homepage: t413/zsh-background-notify
How to use!
Just add bgnotify to your plugins list in your .zshrc
- On OS X you'll need terminal-notifer
brew install terminal-notifier
(orgem install terminal-notifier
)
- On ubuntu you're already all set!
- On windows you can use notifu or the Cygwin Ports libnotify package
Screenshots
Linux
OS X
Windows
Configuration
One can configure a few things:
bgnotify_threshold
sets the notification threshold time (default 6 seconds)function bgnotify_formatted
lets you change the notification
Use these by adding a function definition before the your call to source. Example:
bgnotify_threshold=4 ## set your own notification threshold
function bgnotify_formatted {
## $1=exit_status, $2=command, $3=elapsed_time
[ $1 -eq 0 ] && title="Holy Smokes Batman!" || title="Holy Graf Zeppelin!"
bgnotify "$title -- after $3 s" "$2";
}
plugins=(git bgnotify) ## add to plugins list
source $ZSH/oh-my-zsh.sh ## existing source call