aboutsummaryrefslogtreecommitdiff
path: root/.oh-my-zsh/plugins/bwana
diff options
context:
space:
mode:
authorMarvin Borner2019-03-05 01:09:01 +0100
committerMarvin Borner2019-03-05 01:09:01 +0100
commit55457187d18221e76bd12f0fb2cfab65c49b92fb (patch)
tree8db042d2d80710d54100c2709ad4332153ac848a /.oh-my-zsh/plugins/bwana
Initial commit
Diffstat (limited to '.oh-my-zsh/plugins/bwana')
-rw-r--r--.oh-my-zsh/plugins/bwana/README.md9
-rw-r--r--.oh-my-zsh/plugins/bwana/bwana.plugin.zsh13
2 files changed, 22 insertions, 0 deletions
diff --git a/.oh-my-zsh/plugins/bwana/README.md b/.oh-my-zsh/plugins/bwana/README.md
new file mode 100644
index 0000000..8cbeaa3
--- /dev/null
+++ b/.oh-my-zsh/plugins/bwana/README.md
@@ -0,0 +1,9 @@
+# Bwana
+
+This plugin provides a function to open `man` pages directly with [Bwana](https://www.bruji.com/bwana/).
+
+To use it add bwana to the plugins array in your zshrc file.
+
+```bash
+plugins=(... bwana)
+```
diff --git a/.oh-my-zsh/plugins/bwana/bwana.plugin.zsh b/.oh-my-zsh/plugins/bwana/bwana.plugin.zsh
new file mode 100644
index 0000000..b9a0479
--- /dev/null
+++ b/.oh-my-zsh/plugins/bwana/bwana.plugin.zsh
@@ -0,0 +1,13 @@
+#
+# Requires https://www.bruji.com/bwana/
+#
+if [[ -e /Applications/Bwana.app ]] ||
+ ( system_profiler -detailLevel mini SPApplicationsDataType | grep -q Bwana )
+then
+ function man() {
+ open "man:$1"
+ }
+else
+ echo "Bwana lets you read man files in Safari through a man: URI scheme"
+ echo "To use it within Zsh, install it from https://www.bruji.com/bwana/"
+fi