Using konqueror to navigate through man pages

If you are a KDE user you can use Konqueror for MAN pages navigation, just add "man:" prefix before interested command. For instance enter man:ssh-copy-id to Konqueror's address bar and enjoy nicely rendered MAN page entry and all browser's features like search results highlighting, hyperlinks to the related MAN entries (yay!).
I wrote simple bash script that utilizes man binary functionality but displays MAN page in Konqueror. Put this code to the /usr/local/bin/kman file:

#!/bin/sh

#Su'ed root console support
if [ $UID = 0 ]; then
    su - $LOGNAME -c "env DISPLAY=:0 konqueror man:$@" 2>/dev/null &
else 
    konqueror man:$@ 2>/dev/null &
fi

For autocompletion support add this to the /etc/bash.bashrc.local file:

#konqueror man
complete ${_def} -F _man_ ${_file} kman

Run kman ssh-copy-id and have a fun.
Tested only in Opensuse.

Comments

Popular posts from this blog

Memory efficient array permutation in PHP 5.5 using generators

How to dump http request headers with PHP under CGI/FastCGI SAPI

Jqgrid show totals in the footer plugin