Skip to content

Commit 8626d63

Browse files
Added functionality to add permanent custom flags to the IDE's startup
# Don't clear $FLAGS and rename to $CUSTOM_IDE_FLAGS (#20) * Don't clear $FLAGS and rename to $ELECTRON_FLAGS That way $ELECTRON_FLAGS can be passed to the IDE. Corresponding README section added. * change ELECTRON_FLAGS to CUSTOM_IDE_FLAGS * correct punctuation. * Rewrite readme. And document experimental wayland. * Fix Typo Co-authored-by: Joshua Glass <[email protected]>
1 parent ecce1c8 commit 8626d63

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Flatpak build of [Arduino IDE 2.x](https://github.com/arduino/arduino-ide). To run the
44
app you need USB permissions, preferably, the user has to be part of the
5-
`dialout` group. Alternatively, add
5+
`dialout` group. Alternatively, add:
66
``` sh
77
KERNEL=="ttyUSB[0-9]*",MODE="0666"
88
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.
1919
flatpak run cc.arduino.IDE2 --log-level=warn
2020
```
2121
which only displays warning or above in the log output to the console.
22+
23+
## Adding permanent custom flags to the IDE
24+
If you need to always start the IDE with custom arguments then the best way to do this is to use `flatpak override`.
25+
For example:
26+
``` sh
27+
flatpak override --user --env=CUSTOM_IDE_FLAGS="--log-level=warn" cc.arduino.IDE2
28+
```
29+
This is also useful if you want to enable electron's (potentially experimental) wayland support:
30+
``` sh
31+
flatpak override --user --socket=wayland cc.arduino.IDE2
32+
flatpak override --user --env=CUSTOM_IDE_FLAGS="--enable-features=UseOzonePlatform --ozone-platform=wayland" cc.arduino.IDE2
33+
```
34+
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.

arduino-ide.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
#!/bin/bash
22

3-
FLAGS=''
4-
53
if [[ $XDG_SESSION_TYPE == "wayland" ]] && [ -c /dev/nvidia0 ]
64
then
7-
FLAGS="$FLAGS --disable-gpu-sandbox"
5+
CUSTOM_IDE_FLAGS="$CUSTOM_IDE_FLAGS --disable-gpu-sandbox"
86
fi
97

108
# I cracked zypak's secrets
119
export ZYPAK_SPAWN_LATEST_ON_REEXEC=0
12-
env TMPDIR=$XDG_CACHE_HOME zypak-wrapper /app/arduino-ide/arduino-ide /app/arduino-ide/resources/app/scripts/arduino-ide-electron-main.js $FLAGS "$@"
10+
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 "$@"

0 commit comments

Comments
 (0)