Rockbox Technical Forums

Support and General Use => Plugins/Viewers => Topic started by: Bilgus on March 04, 2021, 12:04:57 PM

Title: OpenPlugin the plugin for opening plugins?
Post by: Bilgus on March 04, 2021, 12:04:57 PM
OpenPlugin

Open plugin is a recent addition to rockbox
at the lowest level it allows storing and hashed lookup of plugins and parameters

its been integrated with the core to enable opening plugins on startup, hotkeys, shortcuts

There is also a companion plugin in the viewers folder to allow you to run plugins using openwith
and a shortcut to the plugin in the apps folder that uses it to start the viewer in editor mode

in edit mode you can export shortcuts back to the file system and use them from the file browser as if you were in the plugin folder

Another use is doing things like making a shortcut that starts the text viewer and loads a specified file using the parameter field

 
Title: Re: OpenPlugin the plugin for opening plugins?
Post by: bahus on March 04, 2021, 11:37:07 PM
I want to be able to open my lua script right from Shortcuts menu in WPS. So I added lua file to Shortcuts but now it simply opens folder where lua script is placed.

Is it possible to run script right away?

>There is also a companion plugin in the viewers folder to allow you to run plugins using openwith

It looks somehow related to my problem.. Though not sure how to proceed with this information :)
Title: Re: OpenPlugin the plugin for opening plugins?
Post by: Bilgus on March 04, 2021, 11:59:42 PM
Open plugins only works for plugins..

So you need to call the viewer and pass the script as a parameter

like this

run Plugins/apps/open_plugins

select any available menu item and long press select for the context menu
choose 'Add'
choose viewers/lua (the .rock file not the lua folder)

you should now have a entry named lua.rock
long press select choose 'Edit'
rename it to something else eg 'testscript'

scroll to [Parameter]
choose parameter it'll ask to Browse? choose 'Yes'
select your lua script
select 'Back'
and Save 'yes'

finally select the entry again and choose 'Export' assuming you leave the default it is now a shortcut named testscript.opx in .rockbox/rocks/apps/
exit back to the main menu and return to Plugins>Apps and you should now see testscript and it starts your script






Title: Re: OpenPlugin the plugin for opening plugins?
Post by: bahus on March 05, 2021, 12:23:10 AM
Got it! Thanks. The fact that I need to go to context menu inside Open plugin to get started was not obvious to me.

But again it's not opened right away from Shortucts menu - it moves me to file in apps folder first :(It seems you can't run apps/scripts right from Shortucts menu.
Title: Re: OpenPlugin the plugin for opening plugins?
Post by: Bilgus on March 05, 2021, 01:02:43 AM
hmm well you could always set the open plugin in the wps context menu
Settings>General Settings>Set Wps Context Plugin

then in wps long press select and choose openplugin from the context menu
Title: Re: OpenPlugin the plugin for opening plugins?
Post by: Bilgus on March 05, 2021, 01:05:48 AM
You can also browse to the plugin and choose openwith open_plugins and it will do the same but you can't get to viewers from the main menu so its easier to do it manually
Title: Re: OpenPlugin the plugin for opening plugins?
Post by: Bilgus on March 06, 2021, 12:26:16 PM
I added an entry 'Add' to the main menu to address your concern it will only add it if there are no other entries though
so delete plugins.dat from .rockbox/rocks/ and re-open open_plugins and you should now have an entry ADD