Repository navigation
UI configuration via Lua scripts #2531
joelim-work
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
So today I decided to bite the bullet and experiment with Lua scripting using the GopherLua library. It turns out to be straightforward enough to get a PoC working, in this case customizing the prompt line:
Diff (click to expand):
Lua script
~/.config/lf/init.lua:The current PoC achieves this by doing the following:
uistruct since this is a PoC, but could be moved toapp)gLuaPathswhich contains the paths to lookup Lua scripts (calledinit.lua)gLuaPathsand execute eachinit.luascript (in this case define thepromptfunction)promptfunction, passing in relevant information, and display the resultThis does open up a whole new range of possibilities, for example:
fmt), the colors/icons files and the recently introduced ruler file would be rendered completely obsolete:toggle; downlfrcfile could be made obsolete as it is just a runtime script evaluated upon startup and could be replaced by a Lua scriptI doubt I'll have the time to look at this in the near future, but anyway I'll leave this here in case anyone is interested in working on this further.
All reactions