Mocca101/obsidian-plugin-groups

FR: Device switch

Closed this issue ยท 10 comments

It'd be cool to have the ability to choose a device for group (mobile/pc). It'll be very helpful to delay startup of a group of heavy plugins on mobile.

+1

Not only mobile/desktop, but also work desktop and home desktop would make sense, since you are sometimes using slightly different setups in both

Good idea! I'll look into it

If I can help, for Group snippets, I just "simply" detect the platform (for example "mobile") using const platform = Platform.isDesktop ? 'desktop' : 'mobile'
I, after, activate the snippets if the group name contains the word mobile or desktop. If the group doesn't contain the word, then it's both.

On another hand, with my fast-start user plugin snippets, I used that :

if (!plugin.app.isMobile) { 
	// run here the desktop group
} else {
	// run here the mobile group 
}

Note, I think it can be good to use directly the object returned by Plateform to differentiate multiple platform :
image

To be honest, I'm curious how can we differentiate two computer running the same OS.

Thanks for the advice! The way I'm approaching it now is through letting users create device names, and then setting the current device by Saving the name to the local storage (probably per vault, but I'm open for input wether it should be per vault & device or just per device). Thanks to Licat for pointing me in that direction!

Oh, I dunno it was possible! But, yes, good idea :D

There's now a new release available with BRAT, please let me know if this works the way you imagened it to or not. And of course if you encounter any bugs/unexpected behaviour.

Tested on my phone, loading time was reduced to 3 seconds instead of 7! I excluded all plugins except plugin groups inside community-plugins.json and have no issues with functionality. But I'll continue testing.

Waiting for public release in community plugins. Thanks!

Really happy to hear that!

As there seem to be no issues I'll close this issue for now.