Skip to content

Instantly share code, notes, and snippets.

@pierew
Created April 22, 2015 12:04
Show Gist options
  • Save pierew/61376800e93a43f7bb78 to your computer and use it in GitHub Desktop.
Save pierew/61376800e93a43f7bb78 to your computer and use it in GitHub Desktop.
iarchwiki - Please install to /usr/local/bin/
#!/bin/bash
function dependencies() {
echo "Check for dependencies"
echo "Check: w3m"
if [[ "" =~ "$(which w3m)" ]]; then
echo "w3m [Install]"
sudo pacman -Sy --noconfirm w3m
fi
echo "w3m [OK]"
echo "Check: arch-wiki-lite"
if [[ "" =~ "$(which wiki-search-html)" ]]; then
echo "arch-wiki-lite [Install]"
yaourt -Sy --noconfirm arch-wiki-lite
fi
echo "arch-wiki-lite [OK]"
}
function iwiki() {
clear
echo "#############################################"
echo "# Arch Wiki HTML Search Offline Interactive #"
echo "#############################################"
echo "# Controls: #"
echo "# * Press CTRL+C for Quit #"
echo "# * Press q for Quit Terminal Browser #"
echo "#############################################"
export wiki_browser=$(which w3m)
read -p "Enter Keyword to search: " SEARCH
wiki-search-html $SEARCH
read -p "Choose a Option: " OPTION
wiki-search-html $OPTION
unset SEARCH
unset OPTION
iwiki
}
dependencies
iwiki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment