Skip to content

Conversation

Czaki
Copy link
Contributor

@Czaki Czaki commented Sep 22, 2025

References and relevant issues

Closes #842

Depends on napari/napari#8188

Description

Document the startup script feature.

Directly mention that feature is not for plugins.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Sep 22, 2025
@Czaki Czaki added this to the 0.6.5 milestone Sep 22, 2025
This can be done by providing a script path in a Settings » Application » Startup script.
This is useful for adding a
[custom colormap](https://github.com/napari/napari/blob/main/examples/dev/settings_startup_script.py)
or loading a specific plugin every time napari starts.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that the startup script is equivalent to just drag-n-drop a script immediately on a viewer? I mean in terms of order of operations and overall behavior.
Is that correct? if so, then let's mention that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Did you have a suggestion?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@psobolewskiPhD what other behavior would there be? Pardon my confusion but isn't opening napari just running a series of code steps, this included?I guess we can explicitly state it but hard to imagine some other functionality, for me.

or loading a specific plugin every time napari starts.

```{note}
This feature is intended only for users. Plugin are not allowed to modify this setting.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This feature is intended only for users. Plugin are not allowed to modify this setting.
This feature is intended only for users. Plugins should not modify this setting.

Right? they physically can, but they should not.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They actually can't, not by using plugin machinery.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is blocked in the code. To set it from the plugin, you need to hack.

Czaki and others added 2 commits September 23, 2025 09:05
Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
Co-authored-by: Tim Monko <timmonko@gmail.com>
@brisvag brisvag merged commit aad68a3 into napari:main Sep 24, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add info on startup script
4 participants