From 6008573893f8d0671101a8a9064a6b827ca273c7 Mon Sep 17 00:00:00 2001 From: Sebastian Fleer Date: Fri, 30 Sep 2022 18:14:23 +0200 Subject: [PATCH 1/5] Don't clear $FLAGS and rename to $ELECTRON_FLAGS That way $ELECTRON_FLAGS can be passed to the IDE. Corresponding README section added. --- README.md | 6 +++++- arduino-ide.sh | 6 ++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 07565a1..0881acb 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,7 @@ 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. +If you like to pass certain flags permanently, you can add them to the `ELECTRON_FLAGS` environment variable: +``` sh +flatpak override --user --env=ELECTRON_FLAGS="--log-level=warn" cc.arduino.IDE2 +``` diff --git a/arduino-ide.sh b/arduino-ide.sh index 6193758..042e5ad 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" + ELECTRON_FLAGS="$ELECTRON_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 $ELECTRON_FLAGS "$@" From 70ad2a838ce6eba1bfafb4737119f152c3f40277 Mon Sep 17 00:00:00 2001 From: Joshua Glass <28513051+joshuag1000@users.noreply.github.com> Date: Fri, 30 Sep 2022 21:07:08 +0100 Subject: [PATCH 2/5] change ELECTRON_FLAGS to CUSTOM_IDE_FLAGS --- arduino-ide.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arduino-ide.sh b/arduino-ide.sh index 042e5ad..f640ee4 100644 --- a/arduino-ide.sh +++ b/arduino-ide.sh @@ -2,9 +2,9 @@ if [[ $XDG_SESSION_TYPE == "wayland" ]] && [ -c /dev/nvidia0 ] then - ELECTRON_FLAGS="$ELECTRON_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 $ELECTRON_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 "$@" From 600a78c4d130c333e02fc04c3447eedab9f2cbbf Mon Sep 17 00:00:00 2001 From: Joshua Glass <28513051+joshuag1000@users.noreply.github.com> Date: Fri, 30 Sep 2022 21:07:43 +0100 Subject: [PATCH 3/5] correct punctuation. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0881acb..f8fd2c5 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" From 38b4c443fc26250c54da49c4385b87df94736155 Mon Sep 17 00:00:00 2001 From: Joshua Glass <28513051+joshuag1000@users.noreply.github.com> Date: Fri, 30 Sep 2022 21:18:33 +0100 Subject: [PATCH 4/5] Rewrite readme. And document experimental wayland. --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f8fd2c5..8f7b5f0 100644 --- a/README.md +++ b/README.md @@ -19,7 +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. -If you like to pass certain flags permanently, you can add them to the `ELECTRON_FLAGS` environment variable: + +## 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 --env=ELECTRON_FLAGS="--log-level=warn" cc.arduino.IDE2 +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 turn this off before submitting a bug report here or on the IDE's bug tracker as this functionality is not functionality supported. From a4beebcce98c03cac804baf349c7329b945cabe6 Mon Sep 17 00:00:00 2001 From: Joshua Glass <28513051+joshuag1000@users.noreply.github.com> Date: Fri, 30 Sep 2022 21:25:14 +0100 Subject: [PATCH 5/5] Fix Typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8f7b5f0..effe131 100644 --- a/README.md +++ b/README.md @@ -31,4 +31,4 @@ This is also useful if you want to enable electron's (potentially experimental) 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 turn this off before submitting a bug report here or on the IDE's bug tracker as this functionality is not functionality supported. +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.