#!/bin/bash # By default, download 'en-US' DICT=${1:-"en-US"} # Find out what the actual filename of the dictionary is, for example 'en-US': DICTURL="$(lynx -dump 'https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries/+/refs/heads/main/' |grep -E "/${DICT}-[0-9].*.bdic" |tail -1 |tr -d '[[:space:]]' |cut -d. -f2-)" if [ -z "${DICTURL}" ]; then echo "** Dictionary '${DICT}' not found!" exit 1 fi # Full filename of the dictionary: FULLDICT="$(echo $DICTURL |rev |cut -d/ -f1 |rev)" # Should exist already but just be safe: mkdir -p ~/.config/chromium-ungoogled/Dictionaries # Download the specific hunspell dictionary into the user profile: wget -qO- "${DICTURL}"'?format=TEXT' | base64 -d > ~/.config/chromium-ungoogled/Dictionaries/${FULLDICT}