Skip to content

Don't clear $FLAGS and rename to $ELECTRON_FLAGS #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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.
6 changes: 2 additions & 4 deletions arduino-ide.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"