MAC_VESION=$(sw_vers -productVersion) MAC_VERSION_MAJOR=$(sw_vers -productVersion | cut -d. -f1) MAC_REQUIRED=11 if [ $MAC_VERSION_MAJOR -lt $MAC_REQUIRED ]; then echo Can not install JOKey on your Mac! echo Your macOS version is $MAC_VESION, minimum required is macOS version $MAC_REQUIRED exit fi if [ -n "$V" ]; then JOKEY_VERSION=$V else JOKEY_VERSION=$(curl -sS https://afixer.app/jokey/version.txt) fi echo JOKey v$JOKEY_VERSION ZIP_FILE=JOKey-$JOKEY_VERSION.zip TMP_ZIP_FILE=/tmp/$ZIP_FILE echo Download $ZIP_FILE curl -sSf https://afixer.app/jokey/$ZIP_FILE -o $TMP_ZIP_FILE > /dev/null 2>&1 if [ $? -ne 0 ]; then echo Download failed, visit https://afixer.app/jokey/install#versions to get the available versions exit fi echo Stop JOKey process pkill -f JOKey echo Remove JOKey.app rm -Rf ~/Library/Input\ Methods/JOKey.app echo Extract new JOKey.app ditto -xk $TMP_ZIP_FILE ~/Library/Input\ Methods echo Cleanup rm -f $TMP_ZIP_FILE echo Enable JOKey ~/Library/Input\ Methods/JOKey.app/Contents/MacOS/JOKey enable echo Select JOKey while [[ $(~/Library/Input\ Methods/JOKey.app/Contents/MacOS/JOKey select) == "disabled" ]] ; do sleep 1 done echo Disable spelling autocorrect defaults write -g ApplePressAndHoldEnabled -bool false defaults write -g NSAllowContinuousSpellChecking -bool false defaults write -g NSAutomaticSpellingCorrectionEnabled -bool false defaults write -g NSAutomaticTextCompletionEnabled -bool false defaults write -g WebAutomaticSpellingCorrectionEnabled -bool false defaults write -g NSAutomaticCapitalizationEnabled -bool false defaults write -g NSAutomaticQuoteSubstitutionEnabled -bool false echo Done