Moved from luasec to pure curl implementation. mcstatus is now async.
This commit is contained in:
parent
0ab3c47607
commit
f490e6e8ef
|
@ -4,7 +4,6 @@ lanxu awesome scripts
|
|||
Requirements
|
||||
------------
|
||||
|
||||
- luasec (for https connections)
|
||||
- dkjson (for parsing json. Available with this widget)
|
||||
|
||||
How to use
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
local naughty = require("naughty")
|
||||
local wibox = require("wibox")
|
||||
local json = require("lanxu/dkjson")
|
||||
local https = require("ssl.https")
|
||||
local gears = require("gears")
|
||||
local focused = require("awful.screen").focused
|
||||
local easy_async = require("awful.spawn").easy_async
|
||||
|
||||
local function factory(args)
|
||||
local args = args or {}
|
||||
|
@ -55,7 +55,9 @@ local function factory(args)
|
|||
end
|
||||
|
||||
function minecraft.update()
|
||||
local response, error = https.request(calluri)
|
||||
local cmd = string.format("curl -s " .. "'" .. calluri .. "'")
|
||||
|
||||
easy_async(cmd, function(response, stderr, reason, exit_code)
|
||||
local obj, pos, err = json.decode(response, 1, nil)
|
||||
|
||||
totalplayers = 0
|
||||
|
@ -96,6 +98,7 @@ local function factory(args)
|
|||
widget = minecraft.widget
|
||||
settings()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
minecraft.attach(minecraft.widget)
|
||||
|
|
Loading…
Reference in New Issue
Block a user