Skip to content

Commit

Permalink
only apply font workaround on ubuntu-derivatives
Browse files Browse the repository at this point in the history
Closes #109
  • Loading branch information
tom-james-watson committed Jun 20, 2023
1 parent 538c21f commit a6abad4
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions static/prepare-launch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

if [ ! -d "$SNAP_USER_DATA/.config/autostart" ];
then
Expand All @@ -11,7 +11,14 @@ fi
export GDK_BACKEND="x11"

# Workaround for https://bugs.launchpad.net/snapcraft/+bug/1998269.
export FONTCONFIG_PATH=$SNAP/etc/fonts/config.d
export FONTCONFIG_FILE=$SNAP/etc/fonts/fonts.conf
# On ubuntu-derived systems, we end up with tiny emojis without this.
# If we apply this fix on other systems then fonts end up messed up.
if [ -f /etc/lsb-release ]; then

This comment has been minimized.

Copy link
@SuperSandro2000

SuperSandro2000 Jun 20, 2023

This check is not enough. The file also exists on NixOS. You want to source /etc/os-release and check if $ID is ubuntu or source lsb-release and check if DISTRIB_ID is Ubuntu

echo "Running on an Ubuntu-derived system, trying to fix font issue."
export FONTCONFIG_PATH=$SNAP/etc/fonts/config.d
export FONTCONFIG_FILE=$SNAP/etc/fonts/fonts.conf
else
echo "Not running on an Ubuntu-derived system. Nothing to do."
fi

exec "$@"

0 comments on commit a6abad4

Please sign in to comment.