diff --git a/.local/share/scripts/arch-wiki.sh b/.local/share/scripts/arch-wiki.sh new file mode 100755 index 0000000..12b042f --- /dev/null +++ b/.local/share/scripts/arch-wiki.sh @@ -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 + +