Go Down

Topic: Custom Default sketch loading when launching the IDE (Mac OS) (Read 855 times) previous topic - next topic

J-M-L

When we launch the IDE, the bareMinimum.ino sketch is loaded.

I don't like it. it drives me crazy with the '{' on the same line as the function name (I want it below on a line by itself) or comments for beginners that I need to delete.. and the first thing I have to type is usually a
Code: [Select]
Serial.begin(115200);

so in a nutshell, whilst it's OK for a new starter, I would want my default sketch to look like this:
Code: [Select]
void setup()
{
  Serial.begin(115200);
 
}

void loop()
{

}


In the past I would just go and edit (at every new version) the bareMinimum.ino sketch and be done with it.

Now the it seems the Arduino IDE package is signed, so if I go and edit directly the file which is embedded in the IDE .app file, I'm changing the signature and macOS (gateKeeper) will bark at me trying to use corrupted software.

is there a defaults write ... option or something to edit/add somewhere in a preference file to point somewhere else in user space for a personal custom default program?
Hello - Please do not PM me for help,  others will benefit as well if you post your question publicly on the forums.
Bonjour Pas de messages privés SVP, postez dans le forum directement pour que ça profite à tous

pert

I think this is where it's set:
https://github.com/arduino/Arduino/blob/933bbb3a3975329e549331c447eb99c4cde2dd11/app/src/processing/app/Base.java#L767
So you'd need to edit that line and then build the Arduino IDE from source:
https://github.com/arduino/Arduino/wiki/Building-Arduino

For me, an easier solution would be to set the shortcut I use to open the Arduino IDE to open my preferred template sketch.

J-M-L

thanks - yes, but really if I recompile the IDE, I could also modify the sketch and re-sign the package.. looking for a low impact solution

For me, an easier solution would be to set the shortcut I use to open the Arduino IDE to open my preferred template sketch.
Command line ? on my mac I usually just click on the IDE in the dock.
Hello - Please do not PM me for help,  others will benefit as well if you post your question publicly on the forums.
Bonjour Pas de messages privés SVP, postez dans le forum directement pour que ça profite à tous

pert

Shortcuts are part of the Windows GUI. It's a special type of file that points to another file. All the programs in the Windows Start menu are shortcuts. You can configure shortcuts to pass command line arguments to the programs. I have no experience with mac, but I'm certain there is an equivalent. Can you copy a link to your template sketch to the dock? As long as .ino files are associated with the Arduino IDE, opening an .ino file should open it in the Arduino IDE.

J-M-L

well -  need a script that would create a temporary file otherwise you end up editing your template. I guess I could try making the file write protected so that would force me saving it somewhere else....

still would be easier to have the capability in the IDE pref file instead of hardwiring BareMinimum in the source code.
 
Hello - Please do not PM me for help,  others will benefit as well if you post your question publicly on the forums.
Bonjour Pas de messages privés SVP, postez dans le forum directement pour que ça profite à tous

Go Up