diff --git a/README.md b/README.md index 07565a1..effe131 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Flatpak build of [Arduino IDE 2.x](https://github.com/arduino/arduino-ide). To run the app you need USB permissions, preferably, the user has to be part of the -`dialout` group. Alternatively, add +`dialout` group. Alternatively, add: ``` sh KERNEL=="ttyUSB[0-9]*",MODE="0666" KERNEL=="ttyACM[0-9]*",MODE="0666" @@ -19,3 +19,16 @@ Any arguments passed to the flatpak run command will be passed to the IDE i.e. flatpak run cc.arduino.IDE2 --log-level=warn ``` which only displays warning or above in the log output to the console. + +## Adding permanent custom flags to the IDE +If you need to always start the IDE with custom arguments then the best way to do this is to use `flatpak override`. +For example: +``` sh +flatpak override --user --env=CUSTOM_IDE_FLAGS="--log-level=warn" cc.arduino.IDE2 +``` +This is also useful if you want to enable electron's (potentially experimental) wayland support: +``` sh +flatpak override --user --socket=wayland cc.arduino.IDE2 +flatpak override --user --env=CUSTOM_IDE_FLAGS="--enable-features=UseOzonePlatform --ozone-platform=wayland" cc.arduino.IDE2 +``` +It is important to note that if you are experiencing issues with the IDE you MUST disable any custom flags you have before submitting a bug report here or on the IDE's bug tracker as this functionality is not officially supported. diff --git a/arduino-ide.sh b/arduino-ide.sh index 6193758..f640ee4 100644 --- a/arduino-ide.sh +++ b/arduino-ide.sh @@ -1,12 +1,10 @@ #!/bin/bash -FLAGS='' - if [[ $XDG_SESSION_TYPE == "wayland" ]] && [ -c /dev/nvidia0 ] then - FLAGS="$FLAGS --disable-gpu-sandbox" + CUSTOM_IDE_FLAGS="$CUSTOM_IDE_FLAGS --disable-gpu-sandbox" fi # I cracked zypak's secrets export ZYPAK_SPAWN_LATEST_ON_REEXEC=0 -env TMPDIR=$XDG_CACHE_HOME zypak-wrapper /app/arduino-ide/arduino-ide /app/arduino-ide/resources/app/scripts/arduino-ide-electron-main.js $FLAGS "$@" +env TMPDIR=$XDG_CACHE_HOME zypak-wrapper /app/arduino-ide/arduino-ide /app/arduino-ide/resources/app/scripts/arduino-ide-electron-main.js $CUSTOM_IDE_FLAGS "$@"