diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 694f6ee45..ac9ee4eac 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -60,6 +60,7 @@ jobs: --compress=1 - name: Run jpackage run: > + envsubst '${SEMVER_STR} ${REVISION_NUM}' < dist/linux/launcher-gtk2.properties > launcher-gtk2.properties ${JAVA_HOME}/bin/jpackage --verbose --type app-image @@ -83,6 +84,7 @@ jobs: --java-options "-Dcryptomator.mountPointsDir=\"~/.local/share/Cryptomator/mnt\"" --java-options "-Dcryptomator.showTrayIcon=false" --java-options "-Dcryptomator.buildNumber=\"appimage-${{ steps.versions.outputs.revNum }}\"" + --add-launcher Cryptomator-gtk2=launcher-gtk2.properties \ --resource-dir dist/linux/resources - name: Patch Cryptomator.AppDir run: | diff --git a/dist/linux/appimage/build.sh b/dist/linux/appimage/build.sh index 6dd670df2..3cd080de5 100755 --- a/dist/linux/appimage/build.sh +++ b/dist/linux/appimage/build.sh @@ -26,6 +26,7 @@ ${JAVA_HOME}/bin/jlink \ --compress=1 # create app dir +envsubst '${SEMVER_STR} ${REVISION_NUM}' < dist/linux/launcher-gtk2.properties > launcher-gtk2.properties ${JAVA_HOME}/bin/jpackage \ --verbose \ --type app-image \ @@ -48,6 +49,7 @@ ${JAVA_HOME}/bin/jpackage \ --java-options "-Dcryptomator.mountPointsDir=\"~/.local/share/Cryptomator/mnt\"" \ --java-options "-Dcryptomator.showTrayIcon=false" \ --java-options "-Dcryptomator.buildNumber=\"appimage-${REVISION_NO}\"" \ + --add-launcher cryptomator-gtk2=launcher-gtk2.properties \ --resource-dir ../resources # transform AppDir diff --git a/dist/linux/appimage/resources/AppDir/bin/cryptomator.sh b/dist/linux/appimage/resources/AppDir/bin/cryptomator.sh index 82c3e01ca..80b919c72 100755 --- a/dist/linux/appimage/resources/AppDir/bin/cryptomator.sh +++ b/dist/linux/appimage/resources/AppDir/bin/cryptomator.sh @@ -15,26 +15,11 @@ elif command -v pacman &> /dev/null; then # don't forget arch GTK3_PRESENT=`pacman -Qi gtk3 &> /dev/null; echo $?` fi -if [ "$GTK2_PRESENT" -eq 0 ] && [ "$GTK3_PRESENT" -ne 0 ]; then - GTK_FLAG="-Djdk.gtk.version=2" -fi - # workaround for https://github.com/cryptomator/cryptomator-linux/issues/27 export LD_PRELOAD=lib/app/libjffi.so -# start Cryptomator -./lib/runtime/bin/java \ - -p "lib/app/mods" \ - -cp "lib/app/*" \ - -Dfile.encoding="utf-8" \ - -Dcryptomator.logDir="~/.local/share/Cryptomator/logs" \ - -Dcryptomator.pluginDir="~/.local/share/Cryptomator/plugins" \ - -Dcryptomator.mountPointsDir="~/.local/share/Cryptomator/mnt" \ - -Dcryptomator.settingsPath="~/.config/Cryptomator/settings.json:~/.Cryptomator/settings.json" \ - -Dcryptomator.ipcSocketPath="~/.config/Cryptomator/ipc.socket" \ - -Dcryptomator.buildNumber="appimage-${REVISION_NO}" \ - -Dcryptomator.appVersion="${SEMVER_STR}" \ - $GTK_FLAG \ - -Xss5m \ - -Xmx256m \ - -m org.cryptomator.desktop/org.cryptomator.launcher.Cryptomator +if [ "$GTK2_PRESENT" -eq 0 ] && [ "$GTK3_PRESENT" -ne 0 ]; then + ./bin/Cryptomator-gtk2 +else + ./bin/Cryptomator +fi \ No newline at end of file diff --git a/dist/linux/launcher-gtk2.properties b/dist/linux/launcher-gtk2.properties new file mode 100644 index 000000000..bf4727fa9 --- /dev/null +++ b/dist/linux/launcher-gtk2.properties @@ -0,0 +1,12 @@ +java-options=-Xss5m \ + -Xmx256m \ + -Dfile.encoding=\"utf-8\" \ + -Dcryptomator.appVersion=\"${SEMVER_STR}\" \ + -Dcryptomator.logDir=\"~/.local/share/Cryptomator/logs\" \ + -Dcryptomator.pluginDir=\"~/.local/share/Cryptomator/plugins\" \ + -Dcryptomator.settingsPath=\"~/.config/Cryptomator/settings.json:~/.Cryptomator/settings.json\" \ + -Dcryptomator.ipcSocketPath=\"~/.config/Cryptomator/ipc.socket\" \ + -Dcryptomator.mountPointsDir=\"~/.local/share/Cryptomator/mnt\" \ + -Dcryptomator.showTrayIcon=false \ + -Dcryptomator.buildNumber=\"appimage-${REVISION_NUM}\" \ + -Djdk.gtk.version=2 \ No newline at end of file