From a6abad4193ac00aa4b2fe8c96659fc2491dc18a9 Mon Sep 17 00:00:00 2001 From: Tom Watson Date: Tue, 20 Jun 2023 20:51:34 +0200 Subject: [PATCH] only apply font workaround on ubuntu-derivatives Closes https://github.com/tom-james-watson/Emote/issues/109 --- static/prepare-launch | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/static/prepare-launch b/static/prepare-launch index 30a6fec..5c45773 100755 --- a/static/prepare-launch +++ b/static/prepare-launch @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash if [ ! -d "$SNAP_USER_DATA/.config/autostart" ]; then @@ -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 + 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 "$@"