Not official plugin: Toggle Snippets, Plugins and Themes

I use a lot of snippets (i.e. my theme only has colors and all other changes I do with snippets, so I can easily customize). But debugging gets annoying when you have to individually turn off and on like 30 snippets. So, I created a plugin that creates 4 status bar buttons that do the following (one button for each):

  1. Toggle snippets: this toggles all active snippets off and then back on when clicked the second time. It saves the active snippets list, so it only enables snippets you had enabled before the toggle off.
  2. Toggle plugins: this toggles all active plugins off, except THIS PLUGIN (do so manually) and then back on when desired. If you do manually toggle this off, the list of active plugins and the enabled/disabled state is saved, so you only need to manually toggle this particular plugin, rest will work with one click.
  3. Toggle color theme: this will toggle your custom theme to default and back.
  4. Toggle light/dark mode: this works like the Theme Picker plugin, from where I customized the logic. Toggle easily between light and dark.

I’m not interested in making this an official plugin and I don’t guarantee it works in every case, but when I was looking for these (especially one that does the snippets), I saw other people wishing for the functionality, so I thought I would share. I will add others that I have this same folder, so that’s why it’s not specific to this plugin, these are all small tweaks so I can get things done the way I like. If someone else finds them useful: great.

Also, if someone else wants to make any of these an official plugin and maintain it: go ahead, I’ll only maintain so far that it works with my specific configuration. I don’t promise that this doesn’t break with some other plugin.

With all the caveats, you can find the plugin here: GitHub - RankkaApina/obsidian-plugins: Personal obsidian plugins

2 Likes

A thing you may want to add (if you didn’t already) is to reload the app when it toggles plugins, because plugins don’t always fully unload when you toggle them off. The Restricted Mode toggle does this now, tho it used to not.

1 Like

Added, thanks for that.

If it was in its own repo, maybe it should be enough to use BRAT to install it?

But thanks. Very useful plugin.

You can, mainly I don’t want to make this official in any way: I don’t have the capacity to keep this updated, and worry only about it working for me personally.

If someone else wants to take it and make it more official, I don’t mind. Would appreciate credit, but I’m not even super worried about that. I’m just sharing things like this, because I’ve learned so much from other people sharing and having their code online. While coding is somewhat part of my work, this is not really something I need to showcase: more of a hobby, or obsession really. Obsession to make things work as I want them to work (and refusing to accept alternatives :rofl:) Probably could do some work with my head there :winking_face_with_tongue: