Rubick
Rubick is an open source clone of uTools.
Here is the documentation for extension development: https://rubickcenter.github.io/docs/dev/
Plugin Types
ui (UI 插件)
A "main": "index.html", is provided in package.json to specify the entry point of the plugin.
system (系统插件)
"entry": "index.js", is provided in package.json to specify the entry point of the plugin.
Sample index.js for a system plugin:
Publish Plugin
Send a PR to https://gitcode.net/rubickcenter/rubick-database/-/blob/master/plugins/total-plugins.json
Extension API
https://rubickcenter.github.io/docs/dev/api.html
事件 Events
-
onPluginReady(callback)andonPluginEnter(callback)-
Callback returns an object with plugin environment information
code: feature code inpackage.jsontype:feature.cmd.typeinpackage.json, could betext,img,files,regex,over,windowpayload: String | Object | Array:feature.cmd.type对应匹配的数据-
-
-
onPluginOut(callback)- Callback called with plugin goes to background
Window
hideMainWindow()showMainWindow()setExpendHeight(height)setSubInput(onChange, placeholder)- Subscribe to search bar input changes with
onChangecallback
- Subscribe to search bar input changes with
setSubInputValue(value)- 直接对子输入框的值进行设置
System
showNotification(body)- Show system notification
shellOpenPath(fullPath)- Open file
shellOpenExternal(url)- open url in browser
getPath(name)- Electron API https://www.electronjs.org/docs/latest/api/app#appgetpathname
- Used to get path of some system folders such as
home,appData,userData,temp
Local Database
Rubick's db is based on https://github.com/pouchdb/pouchdb
Read more examples in the doc
It's basically a key-value store.
Source Code Implementation Details
How is this guide?