Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/denpamusic/lua-lcdproc

LCDproc client for Lua
https://github.com/denpamusic/lua-lcdproc

client lcd-display lcdproc lcdproc-client lua lua-lcdproc lua-library luasocket

Last synced: about 1 month ago
JSON representation

LCDproc client for Lua

Awesome Lists containing this project

README

        

# lua-lcdproc - LCDproc client for Lua
## About
lua-lcdproc is a client for [LCDproc](https://github.com/lcdproc/lcdproc) server
written in Lua language using LuaSocket.

## Installation
This project is available on [luarocks](https://luarocks.org/modules/denpamusic/lua-lcdproc).
```
$ luarocks install lua-lcdproc
```

## OpenWrt
You can get OpenWRT package from [my feed](https://github.com/denpamusic/openwrt-feed):
```
$ wget -P /etc/opkg/keys/ http://openwrt.denpa.pro/keys/4b148d164b058d87
$ echo src/gz denpamusic http://openwrt.denpa.pro/packages >> /etc/opkg/customfeeds.conf
$ opkg update && opkg install lua-lcdproc
```

## Usage
```lua
local LCDproc = require "lcdproc"

-- firstly create client instance
local lcd = LCDproc("localhost", 13666)

-- then create some screens...
local screen = lcd:add_screen("my_screen")

-- ...and add some widgets to it
screen:add_title("one", "Title Text")
screen:add_string("two", 1, 2, "First Line Text")
screen:add_string("three", 1, 3, "Second Line Text")
screen:add_string("four", 1, 4, "Third Line Text")

lcd:on_listen(function (screen)
-- text will be updated once screen is visible
screen.widgets.two:set_text("First Line Now Has New Text")
screen.widgets.three:set_text("Second Line Also Does")
end)

lcd:on_ignore(function (screen)
-- do something on screen hide
end)

while true do
local line = lcd:poll()
end

lcd:close()
```

## Documentation
Full documentation is available at [here](https://lua-lcdproc.denpa.pro).