Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
6c5586cb
Unverified
Commit
6c5586cb
authored
Nov 23, 2023
by
Johan Sjöblom
Committed by
GitHub
Nov 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs(bgnotify): match README with current features (#12057)
parent
38e80e9f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
README.md
plugins/bgnotify/README.md
+17
-10
No files found.
plugins/bgnotify/README.md
View file @
6c5586cb
# bgnotify zsh plugin
# bgnotify zsh plugin
cross-platform background notifications for long running commands! Supports OSX and
Ubuntu l
inux.
cross-platform background notifications for long running commands! Supports OSX and
L
inux.
Standalone homepage:
[
t413/zsh-background-notify
](
https://github.com/t413/zsh-background-notify
)
Standalone homepage:
[
t413/zsh-background-notify
](
https://github.com/t413/zsh-background-notify
)
---
-------------------------------
---
## How to use
!
## How to use
Just add bgnotify to your plugins list in your
`.zshrc`
Just add bgnotify to your plugins list in your
`.zshrc`
-
On OS X you'll need
[
terminal-notifier
](
https://github.com/alloy/terminal-notifier
)
-
On OS X you'll need
[
terminal-notifier
](
https://github.com/alloy/terminal-notifier
)
*
`brew install terminal-notifier`
(or
`gem install terminal-notifier`
)
*
`brew install terminal-notifier`
(or
`gem install terminal-notifier`
)
-
On
ubuntu you're already
all set!
-
On
Linux, make sure you have
`notify-send`
or
`kdialog`
installed. If you're using Ubuntu you should already be
all set!
-
On
w
indows you can use
[
notifu
](
https://www.paralint.com/projects/notifu/
)
or the Cygwin Ports libnotify package
-
On
W
indows you can use
[
notifu
](
https://www.paralint.com/projects/notifu/
)
or the Cygwin Ports libnotify package
## Screenshots
## Screenshots
...
@@ -36,19 +36,26 @@ Just add bgnotify to your plugins list in your `.zshrc`
...
@@ -36,19 +36,26 @@ Just add bgnotify to your plugins list in your `.zshrc`
One can configure a few things:
One can configure a few things:
-
`bgnotify_threshold`
sets the notification threshold time (default 6 seconds)
-
`bgnotify_threshold`
sets the notification threshold time (default 6 seconds)
-
`function bgnotify_formatted`
lets you change the notification
-
`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:
Use these by adding a function definition before the your call to source. Example:
~~~
sh
```
sh
bgnotify_threshold
=
4
## set your own notification threshold
bgnotify_threshold
=
4
## set your own notification threshold
function
bgnotify_formatted
{
function
bgnotify_formatted
{
## $1=exit_status, $2=command, $3=elapsed_time
## $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
"
;
# Humanly readable elapsed time
local
elapsed
=
"
$((
$3
%
60
))
s"
((
$3
< 60
))
||
elapsed
=
"
$((
(
$3
%
3600
)
/
60
))
m
$elapsed
"
((
$3
< 3600
))
||
elapsed
=
"
$((
$3
/
3600
))
h
$elapsed
"
[
$1
-eq
0
]
&&
title
=
"Holy Smokes Batman"
||
title
=
"Holy Graf Zeppelin"
[
$1
-eq
0
]
&&
icon
=
"
$HOME
/icons/success.png"
||
icon
=
"
$HOME
/icons/fail.png"
bgnotify
"
$title
- took
${
elapsed
}
"
"
$2
"
"
$icon
"
}
}
plugins
=(
git bgnotify
)
## add to plugins list
plugins
=(
git bgnotify
)
## add to plugins list
source
$ZSH
/oh-my-zsh.sh
## existing source call
source
$ZSH
/oh-my-zsh.sh
## existing source call
~~~
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment