archwiki script improvement

This commit is contained in:
Djeeberjr 2022-09-09 00:08:43 +02:00
parent 160500ab1d
commit 57f2b1100d

View File

@ -9,7 +9,7 @@ set -e
DOC_DIR="/usr/share/doc/arch-wiki/html/en/" DOC_DIR="/usr/share/doc/arch-wiki/html/en/"
cd "$DOC_DIR" cd "$DOC_DIR"
selected=$(find -type f | cut -c3- | rev | cut -c6- | rev | tr _ ' ' | fzf -q "$1") 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"}') selected_file=$(echo "$selected" | tr ' ' _ | awk -v var="$DOC_DIR" '{print var $0 ".html"}')
xdg-open "$selected_file" xdg-open "$selected_file"