Last active
February 10, 2023 17:28
-
-
Save mekb-turtle/3f91296167b099c01b10000d31d9176d to your computer and use it in GitHub Desktop.
script to search locally downloaded ArchWiki pages using dmenu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
HTML_CLIENT="librewolf" | |
AW="/usr/share/doc/arch-wiki/html/$(locale|grep "^LANG="|sed "s|^LANG=||;s|[_. :].*||")" | |
while true; do | |
if [[ -d "$AW" ]]; then | |
cd -- "$AW" | |
RES="$(printf "%s\n" Cancel * | dmenu -i)" | |
if [[ "$RES" == "Cancel" ]]; then exit; fi | |
AW="$AW/$RES" | |
else if [[ -f "$AW" ]]; then | |
"$HTML_CLIENT" "$AW" | |
exit | |
else | |
exit | |
fi; fi | |
done | |
dmenu |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment