diff --git a/frontend/pluginloader.lua b/frontend/pluginloader.lua index 511bba35d..5917b022f 100644 --- a/frontend/pluginloader.lua +++ b/frontend/pluginloader.lua @@ -70,6 +70,10 @@ function PluginLoader:loadPlugins() -- valid koreader plugin directory if mode == "directory" and entry:find(".+%.koplugin$") then local mainfile = plugin_root.."/main.lua" + local metafile = plugin_root.."/_meta.lua" + if plugins_disabled and plugins_disabled[entry:sub(1, -10)] then + mainfile = metafile + end package.path = string.format("%s/?.lua;%s", plugin_root, package_path) package.cpath = string.format("%s/lib/?.so;%s", plugin_root, package_cpath) local ok, plugin_module = pcall(dofile, mainfile) @@ -81,6 +85,10 @@ function PluginLoader:loadPlugins() if (plugins_disabled and plugins_disabled[entry:sub(1, -10)]) then table.insert(self.disabled_plugins, plugin_module) else + local ok_meta, plugin_metamodule = pcall(dofile, metafile) + if ok_meta and plugin_metamodule then + for k,v in pairs(plugin_metamodule) do plugin_module[k] = v end + end sandboxPluginEventHandlers(plugin_module) table.insert(self.enabled_plugins, plugin_module) end diff --git a/plugins/SSH.koplugin/_meta.lua b/plugins/SSH.koplugin/_meta.lua new file mode 100644 index 000000000..123075879 --- /dev/null +++ b/plugins/SSH.koplugin/_meta.lua @@ -0,0 +1,6 @@ +local _ = require("gettext") +return { + name = 'SSH', + fullname = _("SSH"), + description = _([[Connect and transfer files to the device using SSH.]]), +} diff --git a/plugins/SSH.koplugin/main.lua b/plugins/SSH.koplugin/main.lua index b97bc1d03..afc3837c1 100644 --- a/plugins/SSH.koplugin/main.lua +++ b/plugins/SSH.koplugin/main.lua @@ -20,8 +20,6 @@ end local SSH = WidgetContainer:new{ name = 'SSH', - fullname = _("SSH"), - description = _([[Connect and transfer files to the device using SSH.]]), is_doc_only = false, } diff --git a/plugins/autofrontlight.koplugin/_meta.lua b/plugins/autofrontlight.koplugin/_meta.lua new file mode 100644 index 000000000..105db9b9e --- /dev/null +++ b/plugins/autofrontlight.koplugin/_meta.lua @@ -0,0 +1,6 @@ +local _ = require("gettext") +return { + name = "autofrontlight", + fullname = _("Auto frontlight"), + description = _([[Automatically turns the frontlight on and off once brightness in the environment reaches a certain level.]]), +} diff --git a/plugins/autofrontlight.koplugin/main.lua b/plugins/autofrontlight.koplugin/main.lua index 50fb77081..43cc26e28 100644 --- a/plugins/autofrontlight.koplugin/main.lua +++ b/plugins/autofrontlight.koplugin/main.lua @@ -89,8 +89,6 @@ AutoFrontlight:init() local AutoFrontlightWidget = WidgetContainer:new{ name = "autofrontlight", - fullname = _("Auto frontlight"), - description = _([[Automatically turns the frontlight on and off once brightness in the environment reaches a certain level.]]), } function AutoFrontlightWidget:init() diff --git a/plugins/autosuspend.koplugin/_meta.lua b/plugins/autosuspend.koplugin/_meta.lua new file mode 100644 index 000000000..573b9fde8 --- /dev/null +++ b/plugins/autosuspend.koplugin/_meta.lua @@ -0,0 +1,6 @@ +local _ = require("gettext") +return { + name = "autosuspend", + fullname = _("Auto suspend"), + description = _([[Suspends the device after a period of inactivity.]]), +} diff --git a/plugins/autosuspend.koplugin/main.lua b/plugins/autosuspend.koplugin/main.lua index 8bf4d622c..d2684ba8c 100644 --- a/plugins/autosuspend.koplugin/main.lua +++ b/plugins/autosuspend.koplugin/main.lua @@ -112,8 +112,6 @@ AutoSuspend:init() local AutoSuspendWidget = WidgetContainer:new{ name = "autosuspend", - fullname = _("Auto suspend"), - description = _([[Suspends the device after a period of inactivity.]]), } function AutoSuspendWidget:onInputEvent() diff --git a/plugins/backgroundrunner.koplugin/_meta.lua b/plugins/backgroundrunner.koplugin/_meta.lua new file mode 100644 index 000000000..1e6fde8cd --- /dev/null +++ b/plugins/backgroundrunner.koplugin/_meta.lua @@ -0,0 +1,6 @@ +local _ = require("gettext") +return { + name = "backgroundrunner", + fullname = _("Background runner"), + description = _([[Service to other plugins: allows tasks to run regularly in the background.]]), +} diff --git a/plugins/backgroundrunner.koplugin/main.lua b/plugins/backgroundrunner.koplugin/main.lua index a8d6fa882..cf45bc813 100644 --- a/plugins/backgroundrunner.koplugin/main.lua +++ b/plugins/backgroundrunner.koplugin/main.lua @@ -239,8 +239,6 @@ BackgroundRunner:_schedule() local BackgroundRunnerWidget = WidgetContainer:new{ name = "backgroundrunner", - fullname = _("Background runner"), - description = _([[Service to other plugins: allows tasks to run regularly in the background.]]), runner = BackgroundRunner, } diff --git a/plugins/batterystat.koplugin/_meta.lua b/plugins/batterystat.koplugin/_meta.lua new file mode 100644 index 000000000..7ee68b7f7 --- /dev/null +++ b/plugins/batterystat.koplugin/_meta.lua @@ -0,0 +1,6 @@ +local _ = require("gettext") +return { + name = "batterystat", + fullname = _("Battery statistics"), + description = _([[Collects and displays battery statistics.]]), +} diff --git a/plugins/batterystat.koplugin/main.lua b/plugins/batterystat.koplugin/main.lua index ff5f280cc..e511ff3b8 100644 --- a/plugins/batterystat.koplugin/main.lua +++ b/plugins/batterystat.koplugin/main.lua @@ -282,8 +282,6 @@ BatteryStat:init() local BatteryStatWidget = WidgetContainer:new{ name = "batterystat", - fullname = _("Battery statistics"), - description = _([[Collects and displays battery statistics.]]), } function BatteryStatWidget:init() diff --git a/plugins/calibrecompanion.koplugin/_meta.lua b/plugins/calibrecompanion.koplugin/_meta.lua new file mode 100644 index 000000000..7a7cf69eb --- /dev/null +++ b/plugins/calibrecompanion.koplugin/_meta.lua @@ -0,0 +1,6 @@ +local _ = require("gettext") +return { + name = "calibrecompanion", + fullname = _("Calibre companion"), + description = _([[Send documents from calibre library directly to device via Wi-Fi connection]]), +} diff --git a/plugins/calibrecompanion.koplugin/main.lua b/plugins/calibrecompanion.koplugin/main.lua index 246806afe..9abb5a180 100644 --- a/plugins/calibrecompanion.koplugin/main.lua +++ b/plugins/calibrecompanion.koplugin/main.lua @@ -23,8 +23,6 @@ require("ffi/zeromq_h") --]] local CalibreCompanion = InputContainer:new{ name = "calibrecompanion", - fullname = _("Calibre companion"), - description = _([[Send documents from calibre library directly to device via Wi-Fi connection]]), -- calibre companion local port port = 8134, -- calibre broadcast ports used to find calibre server diff --git a/plugins/coverbrowser.koplugin/_meta.lua b/plugins/coverbrowser.koplugin/_meta.lua new file mode 100644 index 000000000..a29616bbb --- /dev/null +++ b/plugins/coverbrowser.koplugin/_meta.lua @@ -0,0 +1,6 @@ +local _ = require("gettext") +return { + name = "coverbrowser", + fullname = _("Cover browser"), + description = _([[Alternative display modes for file browser and history.]]), +} diff --git a/plugins/coverbrowser.koplugin/main.lua b/plugins/coverbrowser.koplugin/main.lua index 8c141d6cd..5060853f9 100644 --- a/plugins/coverbrowser.koplugin/main.lua +++ b/plugins/coverbrowser.koplugin/main.lua @@ -43,8 +43,6 @@ local history_display_mode = false -- not initialized yet local CoverBrowser = InputContainer:new{ name = "coverbrowser", - fullname = _("Cover browser"), - description = _([[Alternative display modes for file browser and history.]]), } function CoverBrowser:init() diff --git a/plugins/evernote.koplugin/_meta.lua b/plugins/evernote.koplugin/_meta.lua new file mode 100644 index 000000000..8f8508cb3 --- /dev/null +++ b/plugins/evernote.koplugin/_meta.lua @@ -0,0 +1,6 @@ +local _ = require("gettext") +return { + name = "evernote", + fullname = _("Evernote"), + description = _([[Exports hightlights and notes to the Evernote cloud.]]), +} diff --git a/plugins/evernote.koplugin/main.lua b/plugins/evernote.koplugin/main.lua index b3243b73f..25478ddff 100644 --- a/plugins/evernote.koplugin/main.lua +++ b/plugins/evernote.koplugin/main.lua @@ -18,8 +18,6 @@ local realpath = require("ffi/util").realpath local EvernoteExporter = InputContainer:new{ name = "evernote", - fullname = _("Evernote"), - description = _([[Exports hightlights and notes to the Evernote cloud.]]), login_title = _("Login to Evernote"), notebook_name = _("KOReader Notes"), evernote_domain = nil, diff --git a/plugins/goodreads.koplugin/_meta.lua b/plugins/goodreads.koplugin/_meta.lua new file mode 100644 index 000000000..e3b0d5696 --- /dev/null +++ b/plugins/goodreads.koplugin/_meta.lua @@ -0,0 +1,6 @@ +local _ = require("gettext") +return { + name = "goodreads", + fullname = _("Goodreads"), + description = _([[Allows browsing and searching the Goodreads database of books.]]), +} diff --git a/plugins/goodreads.koplugin/main.lua b/plugins/goodreads.koplugin/main.lua index be528e86c..5e1e92960 100644 --- a/plugins/goodreads.koplugin/main.lua +++ b/plugins/goodreads.koplugin/main.lua @@ -10,8 +10,6 @@ local NetworkMgr = require("ui/network/manager") local Goodreads = InputContainer:new { name = "goodreads", - fullname = _("Goodreads"), - description = _([[Allows browsing and searching the Goodreads database of books.]]), goodreads_key = "", goodreads_secret = "", } diff --git a/plugins/hello.koplugin/_meta.lua b/plugins/hello.koplugin/_meta.lua new file mode 100644 index 000000000..47864640e --- /dev/null +++ b/plugins/hello.koplugin/_meta.lua @@ -0,0 +1,6 @@ +local _ = require("gettext") +return { + name = 'hello', + fullname = _("Hello"), + description = _([[This is a debugging plugin.]]), +} diff --git a/plugins/hello.koplugin/main.lua b/plugins/hello.koplugin/main.lua index a5d2da6dc..3a1e11499 100644 --- a/plugins/hello.koplugin/main.lua +++ b/plugins/hello.koplugin/main.lua @@ -10,8 +10,6 @@ local _ = require("gettext") local Hello = WidgetContainer:new{ name = 'hello', - fullname = _("Hello"), - description = _([[This is a debugging plugin.]]), is_doc_only = false, } diff --git a/plugins/keepalive.koplugin/_meta.lua b/plugins/keepalive.koplugin/_meta.lua new file mode 100644 index 000000000..3e4da2e95 --- /dev/null +++ b/plugins/keepalive.koplugin/_meta.lua @@ -0,0 +1,6 @@ +local _ = require("gettext") +return { + name = "keepalive", + fullname = _("Keep alive"), + description = _([[Keeps the device awake to prevent automatic Wi-Fi disconnects.]]), +} diff --git a/plugins/keepalive.koplugin/main.lua b/plugins/keepalive.koplugin/main.lua index a676e3341..d6ded6e25 100644 --- a/plugins/keepalive.koplugin/main.lua +++ b/plugins/keepalive.koplugin/main.lua @@ -61,8 +61,6 @@ end local KeepAlive = WidgetContainer:new{ name = "keepalive", - fullname = _("Keep alive"), - description = _([[Keeps the device awake to prevent automatic Wi-Fi disconnects.]]), } function KeepAlive:init() diff --git a/plugins/kobolight.koplugin/_meta.lua b/plugins/kobolight.koplugin/_meta.lua new file mode 100644 index 000000000..a2f2e9ddc --- /dev/null +++ b/plugins/kobolight.koplugin/_meta.lua @@ -0,0 +1,6 @@ +local _ = require("gettext") +return { + name = 'kobolight', + fullname = _("Frontlight gesture controller"), + description = _([[Controls the frontlight with gestures on the left border of screen.]]), +} diff --git a/plugins/kobolight.koplugin/main.lua b/plugins/kobolight.koplugin/main.lua index 18c10700a..53306b876 100644 --- a/plugins/kobolight.koplugin/main.lua +++ b/plugins/kobolight.koplugin/main.lua @@ -22,8 +22,6 @@ local swipe_touch_zone_ratio_warmth = { x = 7/8, y = 1/8, w = 1/8, h = 7/8, } local KoboLight = WidgetContainer:new{ name = 'kobolight', - fullname = _("Frontlight gesture controller"), - description = _([[Controls the frontlight with gestures on the left border of screen.]]), gestureScale = nil, -- initialized in self:resetLayout() } diff --git a/plugins/kosync.koplugin/_meta.lua b/plugins/kosync.koplugin/_meta.lua new file mode 100644 index 000000000..409759f99 --- /dev/null +++ b/plugins/kosync.koplugin/_meta.lua @@ -0,0 +1,6 @@ +local _ = require("gettext") +return { + name = "kosync", + fullname = _("Progress sync"), + description = _([[Synchronizes your reading progess to a server across your KOReader devices.]]), +} diff --git a/plugins/kosync.koplugin/main.lua b/plugins/kosync.koplugin/main.lua index 379f02d9f..d71ad6642 100644 --- a/plugins/kosync.koplugin/main.lua +++ b/plugins/kosync.koplugin/main.lua @@ -20,8 +20,6 @@ end local KOSync = InputContainer:new{ name = "kosync", - fullname = _("Progress sync"), - description = _([[Synchronizes your reading progess to a server across your KOReader devices.]]), is_doc_only = true, title = _("Register/login to KOReader server"), diff --git a/plugins/newsdownloader.koplugin/_meta.lua b/plugins/newsdownloader.koplugin/_meta.lua new file mode 100644 index 000000000..21b563bfc --- /dev/null +++ b/plugins/newsdownloader.koplugin/_meta.lua @@ -0,0 +1,6 @@ +local _ = require("gettext") +return { + name = "newsdownloader", + fullname = _("News downloader"), + description = _([[Retrieves RSS and Atom news entries and saves them as HTML files.]]), +} diff --git a/plugins/newsdownloader.koplugin/main.lua b/plugins/newsdownloader.koplugin/main.lua index d87ef2287..ac91a5e0c 100644 --- a/plugins/newsdownloader.koplugin/main.lua +++ b/plugins/newsdownloader.koplugin/main.lua @@ -17,8 +17,6 @@ local T = FFIUtil.template local NewsDownloader = WidgetContainer:new{ name = "newsdownloader", - fullname = _("News downloader"), - description = _([[Retrieves RSS and Atom news entries and saves them as HTML files.]]), } local initialized = false diff --git a/plugins/perceptionexpander.koplugin/_meta.lua b/plugins/perceptionexpander.koplugin/_meta.lua new file mode 100644 index 000000000..ceafe5d5d --- /dev/null +++ b/plugins/perceptionexpander.koplugin/_meta.lua @@ -0,0 +1,6 @@ +local _ = require("gettext") +return { + name = "perceptionexpander", + fullname = _("Perception expander"), + description = _([[Improves your reading speed with the help of two vertical lines over the text.]]), +} diff --git a/plugins/perceptionexpander.koplugin/main.lua b/plugins/perceptionexpander.koplugin/main.lua index 887c52b97..861704c50 100755 --- a/plugins/perceptionexpander.koplugin/main.lua +++ b/plugins/perceptionexpander.koplugin/main.lua @@ -16,8 +16,6 @@ local Blitbuffer = require("ffi/blitbuffer") local PerceptionExpander = Widget:extend{ is_enabled = nil, name = "perceptionexpander", - fullname = _("Perception expander"), - description = _([[Improves your reading speed with the help of two vertical lines over the text.]]), page_counter = 0, shift_each_pages = 100, margin = 0.1, diff --git a/plugins/readtimer.koplugin/_meta.lua b/plugins/readtimer.koplugin/_meta.lua new file mode 100644 index 000000000..78a0b0b73 --- /dev/null +++ b/plugins/readtimer.koplugin/_meta.lua @@ -0,0 +1,6 @@ +local _ = require("gettext") +return { + name = "readtimer", + fullname = _("Read timer"), + description = _([[Shows an alarm after a specified amount of time.]]), +} diff --git a/plugins/readtimer.koplugin/main.lua b/plugins/readtimer.koplugin/main.lua index b7912a329..11ec9885f 100644 --- a/plugins/readtimer.koplugin/main.lua +++ b/plugins/readtimer.koplugin/main.lua @@ -7,8 +7,6 @@ local _ = require("gettext") local ReadTimer = WidgetContainer:new{ name = "readtimer", - fullname = _("Read timer"), - description = _([[Shows an alarm after a specified amount of time.]]), time = 0, -- The expected time of alarm if enabled, or 0. } diff --git a/plugins/send2ebook.koplugin/_meta.lua b/plugins/send2ebook.koplugin/_meta.lua new file mode 100644 index 000000000..05f6956ae --- /dev/null +++ b/plugins/send2ebook.koplugin/_meta.lua @@ -0,0 +1,6 @@ +local _ = require("gettext") +return { + name = "send2ebook", + fullname = _("Send to eBook"), + description = _([[Receives articles sent with the Send2Ebook PC/Android application.]]), +} diff --git a/plugins/send2ebook.koplugin/main.lua b/plugins/send2ebook.koplugin/main.lua index 19cd31e47..910b27784 100644 --- a/plugins/send2ebook.koplugin/main.lua +++ b/plugins/send2ebook.koplugin/main.lua @@ -17,8 +17,6 @@ local T = FFIUtil.template local Send2Ebook = WidgetContainer:new{ name = "send2ebook", - fullname = _("Send to eBook"), - description = _([[Receives articles sent with the Send2Ebook PC/Android application.]]), } local initialized = false diff --git a/plugins/statistics.koplugin/_meta.lua b/plugins/statistics.koplugin/_meta.lua new file mode 100644 index 000000000..25e8d23f5 --- /dev/null +++ b/plugins/statistics.koplugin/_meta.lua @@ -0,0 +1,6 @@ +local _ = require("gettext") +return { + name = "statistics", + fullname = _("Reader statistics"), + description = _([[Keeps and displays your reading statistics.]]), +} diff --git a/plugins/statistics.koplugin/main.lua b/plugins/statistics.koplugin/main.lua index 9fb66d5d8..33d520ebf 100755 --- a/plugins/statistics.koplugin/main.lua +++ b/plugins/statistics.koplugin/main.lua @@ -29,8 +29,6 @@ local DEFAULT_MAX_READ_SEC = 120 local ReaderStatistics = Widget:extend{ name = "statistics", - fullname = _("Reader statistics"), - description = _([[Keeps and displays your reading statistics.]]), page_min_read_sec = DEFAULT_MIN_READ_SEC, page_max_read_sec = DEFAULT_MAX_READ_SEC, start_current_period = 0, diff --git a/plugins/systemstat.koplugin/_meta.lua b/plugins/systemstat.koplugin/_meta.lua new file mode 100644 index 000000000..9e8899951 --- /dev/null +++ b/plugins/systemstat.koplugin/_meta.lua @@ -0,0 +1,6 @@ +local _ = require("gettext") +return { + name = "systemstat", + fullname = _("System statistics"), + description = _([[Shows system statistics.]]), +} diff --git a/plugins/systemstat.koplugin/main.lua b/plugins/systemstat.koplugin/main.lua index 929494380..8c8c6b4b6 100644 --- a/plugins/systemstat.koplugin/main.lua +++ b/plugins/systemstat.koplugin/main.lua @@ -240,8 +240,6 @@ SystemStat:init() local SystemStatWidget = WidgetContainer:new{ name = "systemstat", - fullname = _("System statistics"), - description = _([[Shows system statistics.]]), } function SystemStatWidget:init() diff --git a/plugins/terminal.koplugin/_meta.lua b/plugins/terminal.koplugin/_meta.lua new file mode 100644 index 000000000..e033b7614 --- /dev/null +++ b/plugins/terminal.koplugin/_meta.lua @@ -0,0 +1,6 @@ +local _ = require("gettext") +return { + name = "terminal", + fullname = _("Terminal"), + description = _([[Executes simple commands and shows their output.]]), +} diff --git a/plugins/terminal.koplugin/main.lua b/plugins/terminal.koplugin/main.lua index 69b4f7d86..d3f6f2834 100644 --- a/plugins/terminal.koplugin/main.lua +++ b/plugins/terminal.koplugin/main.lua @@ -11,8 +11,6 @@ local Screen = require("device").screen local Terminal = WidgetContainer:new{ name = "terminal", - fullname = _("Terminal"), - description = _([[Executes simple commands and shows their output.]]), dump_file = util.realpath(DataStorage:getDataDir()) .. "/terminal_output.txt", command = "", } diff --git a/plugins/texteditor.koplugin/_meta.lua b/plugins/texteditor.koplugin/_meta.lua new file mode 100644 index 000000000..3313eed05 --- /dev/null +++ b/plugins/texteditor.koplugin/_meta.lua @@ -0,0 +1,6 @@ +local _ = require("gettext") +return { + name = "texteditor", + fullname = _("Text editor"), + description = _([[A basic text editor for making small changes to plain text files.]]), +} diff --git a/plugins/texteditor.koplugin/main.lua b/plugins/texteditor.koplugin/main.lua index ebeee11eb..f22a9e5e4 100644 --- a/plugins/texteditor.koplugin/main.lua +++ b/plugins/texteditor.koplugin/main.lua @@ -18,8 +18,6 @@ local T = ffiutil.template local TextEditor = WidgetContainer:new{ name = "texteditor", - fullname = _("Text editor"), - description = _([[A basic text editor for making small changes to plain text files.]]), settings_file = DataStorage:getSettingsDir() .. "/text_editor.lua", settings = nil, -- loaded only when needed -- how many to display in menu (10x3 pages minus our 3 default menu items): diff --git a/plugins/timesync.koplugin/_meta.lua b/plugins/timesync.koplugin/_meta.lua new file mode 100644 index 000000000..aa0ed81d8 --- /dev/null +++ b/plugins/timesync.koplugin/_meta.lua @@ -0,0 +1,6 @@ +local _ = require("gettext") +return { + name = "timesync", + fullname = _("Time sync"), + description = _([[Synchronizes the device time with NTP servers.]]), +} diff --git a/plugins/timesync.koplugin/main.lua b/plugins/timesync.koplugin/main.lua index f9ccbfc64..5d4f93442 100644 --- a/plugins/timesync.koplugin/main.lua +++ b/plugins/timesync.koplugin/main.lua @@ -19,8 +19,6 @@ local NetworkMgr = require("ui/network/manager") local TimeSync = WidgetContainer:new{ name = "timesync", - fullname = _("Time sync"), - description = _([[Synchronizes the device time with NTP servers.]]), } local function currentTime() diff --git a/plugins/zsync.koplugin/_meta.lua b/plugins/zsync.koplugin/_meta.lua new file mode 100644 index 000000000..fb2371c11 --- /dev/null +++ b/plugins/zsync.koplugin/_meta.lua @@ -0,0 +1,6 @@ +local _ = require("gettext") +return { + name = "zsync", + fullname = _("Zsync"), + description = _([[Devices in the same Wi-Fi network can transfer documents between each other directly.]]), +} diff --git a/plugins/zsync.koplugin/main.lua b/plugins/zsync.koplugin/main.lua index a7c0f0012..736f0ad75 100644 --- a/plugins/zsync.koplugin/main.lua +++ b/plugins/zsync.koplugin/main.lua @@ -15,8 +15,6 @@ int rmdir(const char *); require("ffi/zeromq_h") local ZSync = InputContainer:new{ name = "zsync", - fullname = _("Zsync"), - description = _([[Devices in the same Wi-Fi network can transfer documents between each other directly.]]), is_doc_only = true, }