Browse Source

Added the i3-man script

Samuel W. Flint 7 years ago
parent
commit
43c35ce415
1 changed files with 17 additions and 0 deletions
  1. 17 0
      i3-man

+ 17 - 0
i3-man

@@ -0,0 +1,17 @@
+#!/bin/sh
+
+if [ $# -lt 1 ] ; then
+    echo "i3-man show | name"
+fi
+
+if [[ $1 == "show" ]] ; then
+    if [[ -e `which rofi` ]] ; then
+        PAGE=`man -k . | awk -e '{print $1}' | rofi -dmenu -p "man page:"`
+        [[ $PAGE != "" ]] && i3-man $PAGE
+    else
+        PAGE=`man -k . | awk -e '{print $1}' | dmenu`
+        [[ $PAGE != "" ]] && i3-man $PAGE
+    fi
+else
+    i3-sensible-terminal -e "man $1"
+fi