Advertisement
Guest User

Untitled

a guest
Nov 27th, 2022
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.12 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # ---------------------------------------------------------------------
  4. # MCreator Launcher for Unix Like systems with Launcher creation
  5. # ---------------------------------------------------------------------
  6. #
  7.  
  8. # make launcher desktop file
  9. if [[ ! -f "mcreator.desktop" ]]; then
  10.  
  11. pwd=$(pwd)
  12.  
  13. cat > mcreator.desktop <<EOL
  14. [Desktop Entry]
  15. Exec=/bin/bash -c 'cd "${pwd}" && ./mcreator.sh'
  16. Type=Application
  17. Terminal=false
  18. Name=MCreator
  19. Icon=${pwd}/icon.png
  20. EOL
  21.  
  22. chmod +x mcreator.desktop
  23.  
  24. # Is xdg-user-dir available?
  25. if ! command -v xdg-user-dir &> /dev/null
  26. then
  27.     # Use dynamic desktop directory for other languages (#3123)
  28.     userdesktop=$(xdg-user-dir DESKTOP)
  29. else
  30.     # Fall back to hardcoded ~/Desktop
  31.     userdesktop=~/Desktop
  32. fi
  33. cp mcreator.desktop "${userdesktop}"/mcreator.desktop
  34.  
  35. fi
  36.  
  37. # set the classpath
  38. export CLASSPATH='./lib/mcreator.jar:./lib/*'
  39.  
  40. # launch MCreator with bundled java
  41. ./jdk/bin/java --module-path /home/pi/Stiahnuté/ok/MCreator20223/javafx-sdk-17.0.2/lib --add-modules javafx.controls --add-opens=java.base/java.lang=ALL-UNNAMED net.mcreator.Launcher "$1"
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement