Skip to content

Commit

Permalink
Display the notice in a notification after the first run.
Browse files Browse the repository at this point in the history
  • Loading branch information
flexiondotorg committed Jun 14, 2018
1 parent 3d0377c commit 1b0e219
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions snap/scripts/sommelier
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function install_app() {
# Downloads a file with progress using wget and yad
wget "${INSTALL_URL}" -O "${TMPDIR}/${INSTALL_EXE}" 2>&1 | \
perl -p -e '$| = 1; s/^.* +([0-9]+%) +([0-9,.]+[GMKB]) +([0-9hms,.]+).*$/\1\n# Downloading... \2 (\3)/' | \
yad --progress --title="${INSTALL_EXE}" --width=400 --center --no-buttons --auto-close --auto-kill --on-top
yad --progress --title="${INSTALL_EXE}" --width=400 --center --no-buttons --auto-close --auto-kill --on-top --no-escape
# Installs the wine application
env WINEARCH="${WINEARCH}" WINEPREFIX="${WINEPREFIX}" "${WINELOADER}" "${TMPDIR}/${INSTALL_EXE}" /silent
# Removes the cached installer
Expand Down Expand Up @@ -202,7 +202,7 @@ fi
# Initialise wine
if [ ! -f "${WINEPREFIX}/drive_c/windows/win.ini" ]; then
# Splash
yad --window-icon="${SNAP}/meta/gui/tmnationsforever.png" --timeout=15 --timeout-indicator=bottom --text="${NOTICE}" --no-escape --width=460 --center --no-buttons --splash &
yad --timeout=15 --timeout-indicator=bottom --text="${NOTICE}" --no-escape --width=460 --center --no-buttons --splash &
# Create the WINE environment
env WINEARCH="${WINEARCH}" WINEPREFIX="${WINEPREFIX}" "${WINELOADER}" wineboot --init 2>&1 | \
yad --progress --title="Preparing Windows environment" --width=400 --center --no-buttons --auto-close --auto-kill --on-top --pulsate
Expand All @@ -211,6 +211,9 @@ if [ ! -f "${WINEPREFIX}/drive_c/windows/win.ini" ]; then
mkdir -p "${XDG_CACHE_HOME}/winetricks"
echo 0 > "${XDG_CACHE_HOME}/winetricks/track_usage"
fi
else
# Notification
notify-send --icon "${SNAP}/meta/gui/tmnationsforever.png" --expire-time=15000 "Track Mania Nations Forever" "${NOTICE}"
fi

# Launch wineboot/winecfg/winetricks if requested.
Expand All @@ -221,4 +224,4 @@ elif [ -e "${WINE_EXE}" ]; then
launch_app
else
install_app
fi
fi
1 change: 1 addition & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ parts:
- libgdk-pixbuf2.0-0:i386 # yad
- libgtk-3-0:i386 # yad
- libnotify4:i386 # yad
- libnotify-bin:i386 # sommelier
- perl-base:i386 # winetricks
- shared-mime-info:i386
- unzip:i386 # winetricks
Expand Down

0 comments on commit 1b0e219

Please sign in to comment.