Last active
December 12, 2019 00:28
-
-
Save moisadoru/aa96b54a109fe890f4a685d82dd66b11 to your computer and use it in GitHub Desktop.
This file contains 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
#/bin/bash | |
# Installs libfreetype6 2.8.0 into affected electron app. | |
# For more details ee: | |
# https://github.com/atom/atom/issues/15737 | |
# https://github.com/Microsoft/vscode/issues/35675 | |
CRT=$(dpkg-query --showformat='${Version}' --show libfreetype6) | |
CRT=$(echo $CRT | sed -e 's/-.*$//g') | |
if [ "$CRT" != "2.8.1" ]; then | |
echo "libfreetype6 2.8.1 not installed (got $CRT instead), nothing to do." | |
exit | |
fi | |
CPU=$(uname -p) | |
ARCH=$(dpkg --print-architecture) | |
DEB="libfreetype6_2.8-0.2ubuntu2_$ARCH.deb" | |
URL="http://security.ubuntu.com/ubuntu/pool/main/f/freetype/$DEB" | |
copy_freetype () { | |
if [ -d "$1" ]; then | |
cp ./usr/lib/$CPU-linux-gnu/libfreetype.so.* $1 | |
echo "Copied libfreetype6 2.8.0 to '$1'." | |
else | |
echo "Skipping '$1', not installed." | |
fi | |
} | |
# create tmp folder and cd | |
mkdir -p /tmp/fix-freetype-electron | |
cd /tmp/fix-freetype-electron > /dev/null | |
# download freetype 2.8.0 deb | |
wget -q $URL ./ | |
# unpack deb | |
dpkg -x libfreetype6_2.8-0.2ubuntu2_amd64.deb . | |
# atom | |
copy_freetype /usr/share/atom/ | |
# atom-beta | |
copy_freetype /usr/share/atom-beta/ | |
# vscode | |
copy_freetype /usr/share/code/ | |
# vscode-insiders | |
copy_freetype /usr/share/code-insiders/ | |
# add you own... | |
if [ "" != "$1" ]; then | |
copy_freetype "$1" | |
fi | |
# cleanup | |
cd - > /dev/null | |
rm -rf /tmp/fix-freetype-electron | |
echo "---" | |
echo "All done." |
Thanks for efforts. It's working fine in Lubuntu 18.04
Really nice! Thanks!
Thanks a lot for this! Working fine on Debian Testing XFCE/Openbox
Nice! Thanks, it fixed the problem in Visual Studio Code 1.21.1 on Ubuntu Mate 18.04.
Really nice, working fine on Ubuntu 18.04 with atom.
Thanks a lot!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
chmod +x ./fix-freetype-bug.sh
./fix-freetype-bug.sh # tries to fix atom and vscode
fix-freetype-bug.sh /path/to/other/affected/electron/app # tries to fix atom, vscode and your custom electron app