2023-12-23 09:56:09 -08:00
#!/usr/bin/bash
2023-09-15 10:11:36 -07:00
2023-09-17 01:13:52 -07:00
source /etc/default/discover-overlay
2023-09-25 12:20:21 -07:00
IMAGE_INFO="/usr/share/ublue-os/image-info.json"
BASE_IMAGE_NAME=$(jq -r '."base-image-name"' < $IMAGE_INFO)
2023-09-15 10:11:36 -07:00
# Run discover-overlay if discord is installed and we aren't using Wayland.
2023-09-17 01:13:52 -07:00
if [[ ${AUTO_LAUNCH_DISCOVER_OVERLAY} == 1 ]]; then
2023-12-14 14:23:51 -08:00
if grep -q "com.discordapp.Discord\|xyz.armcord.ArmCord\|de.shorsh.discord-screenaudio\|io.github.spacingbat3.webcord\|dev.vencord.Vesktop" <<< $(/usr/bin/flatpak list --app --columns=application); then
2023-09-25 12:20:21 -07:00
if [[ ${BASE_IMAGE_NAME} =~ "kinoite" || "$XDG_SESSION_TYPE" != "wayland" ]]; then
2023-12-12 11:21:21 -08:00
/usr/bin/discover-overlay "$@"
2023-09-27 23:09:12 -07:00
elif [[ ${BASE_IMAGE_NAME} =~ "silverblue" && "$XDG_SESSION_TYPE" == "wayland" && "${LAUNCH_DISCOVER_ON_GNOME_WAYLAND}" == 1 ]]; then
2023-12-12 11:21:21 -08:00
env GDK_BACKEND=x11 /usr/bin/discover-overlay "$@"
2023-09-17 01:13:52 -07:00
fi
2023-09-15 10:11:36 -07:00
fi
fi