added arch wiki offline search
This commit is contained in:
parent
e39a881b41
commit
3cb626d4a5
24
.local/share/scripts/arch-wiki.sh
Executable file
24
.local/share/scripts/arch-wiki.sh
Executable file
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# required packages:
|
||||
# - fzf
|
||||
# - arch-wiki-docs
|
||||
|
||||
set -e
|
||||
|
||||
DOC_DIR="/usr/share/doc/arch-wiki/html/en/"
|
||||
|
||||
cd "$DOC_DIR"
|
||||
selected=$(find -type f | cut -c3- | rev | cut -c6- | rev | tr _ ' ' | fzf -q "$1")
|
||||
selected_file=$(echo "$selected" | tr ' ' _ | awk -v var="$DOC_DIR" '{print var $0 ".html"}')
|
||||
xdg-open "$selected_file"
|
||||
|
||||
|
||||
#if [[ $# -eq 0 ]]; then
|
||||
# # No arguments supplied
|
||||
# xdg-open "$DOC_DIR"
|
||||
#else
|
||||
# grep -rwc '/usr/share/doc/arch-wiki/html/en/' -e 'xorg' | grep -v ":0" | awk -F":" '{print $2,$1}' | sort
|
||||
#fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user