Script to search arch wiki.
This commit is contained in:
parent
39b9eaa5d6
commit
a7c77e64c3
22
dmenu-wiki
Executable file
22
dmenu-wiki
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Search offline copy of the arch wiki
|
||||
|
||||
dir="/usr/share/doc/arch-wiki/html/en/"
|
||||
|
||||
docs="$(find $dir -iname "*.html")"
|
||||
|
||||
main () {
|
||||
choice=$(printf '%s\n' "${docs}" | \
|
||||
cut -d '/' -f8- | \
|
||||
sed -e 's/_/ /g' -e 's/.html//g' | \
|
||||
sort | \
|
||||
dmenu -i -l 20 -p "Arch Wiki Docs:")
|
||||
|
||||
if [ "$choice" ]; then
|
||||
article=$(printf '%s\n' "${dir}${choice}.html" | sed 's/ /_/g')
|
||||
"$BROWSER" "$article"
|
||||
fi
|
||||
}
|
||||
|
||||
main
|
Loading…
Reference in New Issue
Block a user