Scripting Liferea

NOTE: Scripting support will be discontinued starting with 1.7.5!

Liferea allows you two customize its runtime behaviour with the LUA scripting language. There is a set of scripting hooks for which you can register one or more scripts. To create, edit or remove scripts open the "Script Manager" dialog from the "Program" menu. In the dialog select a script hook with the option menu at the top and add/remove scripts to the hook. To edit a script select it in the script list and its code will be loaded into the text editor widget.

All scripts are saved in ~/.liferea_1.4/cache/scripts. So you can edit them directly with your favourite editor. To test run a script select it in the script list, set up Liferea for your test scenario (e.g. select an item) and click the "Run Now" button.

Example Scripts

Mark-All-Read  feed-unselect
Modifies the behaviour of Liferea so that on each feed selection change all items will be marked as read. The default behaviour is to do this only in 2-pane mode.

node = liferea.feedlist_get_selected()
if node ~= nil then
	liferea.node_mark_all_read(node)
end

Open-Folder-On-Select  feed-select
Modifies the behaviour of Liferea so that on each folder selection the folder will be expanded automatically. The default behaviour is not to expand the folder.

node = liferea.feedlist_get_selected()
if node ~= nil then
	if node.type == 1 then
		liferea.ui_node_set_expanded(node, 1)
	end
end

An analog script can be written for the feed-unselect hook to close folders when unselecting.

Generated Bindings

Currently only part of the internal interfaces is accessible from LUA. You can use all functions defined in item.h, node.h, itemlist.h, feedlist.h, ui_node.h, ui_itemlist.h, ui_feedlist.h and ui_mainwindow.h.

For LUA itself all language modules are enabled. You can escape to the operation system with the functions of the OS module. Example: os.execute("/bin/ls").