summarylogtreecommitdiffstats
path: root/cura.sh
blob: 408113e5150658eed91818985cc0b493d155dcb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

# For easier maintainability
CURA_VERSION="VERSION_PLACEHOLDER"
CURA_BIN_PATH="/opt/Ultimaker-Cura/Ultimaker-Cura-$CURA_VERSION.AppImage"
FIXUPS="LD_PRELOAD=/usr/lib/libstdc++.so.6"

[ -n "$WAYLAND_DISPLAY" ] && FIXUPS="$FIXUPS QT_QPA_PLATFORMN=xcb"

# Get full path to avoid Error Message in cura 
[ -n $(dirname "$1") ] && filePath="$(realpath "$1")" || filePath="$1"

# Start cura-appimage without Parameter if not given. ( Avoiding cura Error Message "No file found" )
if [ -z $filePath ]; then
  env ${FIXUPS} $CURA_BIN_PATH
else
  env ${FIXUPS} $CURA_BIN_PATH "$filePath"
fi