Commit b93eb5ad authored by Dylan Araps's avatar Dylan Araps

w3m: Simplify path find.

parent 3889bf8d
...@@ -3571,27 +3571,17 @@ END ...@@ -3571,27 +3571,17 @@ END
get_w3m_img_path() { get_w3m_img_path() {
# Find w3m-img path. # Find w3m-img path.
if [[ -x "/usr/lib/w3m/w3mimgdisplay" ]]; then shopt -s nullglob
w3m_img_path="/usr/lib/w3m/w3mimgdisplay" w3m_paths=(
/usr/{local/,}{lib,libexec,lib64,libexec64}/w3m/w3mi*
elif [[ -x "/usr/libexec/w3m/w3mimgdisplay" ]]; then ~/.nix-profile/libexec/w3m/w3mi*
w3m_img_path="/usr/libexec/w3m/w3mimgdisplay" )
shopt -u nullglob
elif [[ -x "/usr/lib64/w3m/w3mimgdisplay" ]]; then
w3m_img_path="/usr/lib64/w3m/w3mimgdisplay"
elif [[ -x "/usr/libexec64/w3m/w3mimgdisplay" ]]; then
w3m_img_path="/usr/libexec64/w3m/w3mimgdisplay"
elif [[ -x "/usr/local/libexec/w3m/w3mimgdisplay" ]]; then
w3m_img_path="/usr/local/libexec/w3m/w3mimgdisplay"
elif [[ -x "$HOME/.nix-profile/libexec/w3m/w3mimgdisplay" ]]; then [[ -x "${w3m_paths[0]}" ]] && \
w3m_img_path="$HOME/.nix-profile/libexec/w3m/w3mimgdisplay" { w3m_img_path="${w3m_paths[0]}"; return; }
else
err "Image: w3m-img wasn't found on your system" err "Image: w3m-img wasn't found on your system"
fi
} }
get_term_size() { get_term_size() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment