From f49ce21335f2e338248906192ab3e4cd7320a3ae Mon Sep 17 00:00:00 2001 From: Leon Winter Date: Sun, 14 Dec 2008 11:26:34 +0100 Subject: [PATCH] telak: use luasocket instead of external wget Signed-off-by: Julien Danjou --- lib/telak.lua.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/telak.lua.in b/lib/telak.lua.in index 58798e75..eb755caa 100644 --- a/lib/telak.lua.in +++ b/lib/telak.lua.in @@ -6,6 +6,9 @@ -- Grab environment local os = os +local io = io +local http = require("socket.http") +local ltn12 = require("ltn12") local otable = otable local setmetatable = setmetatable local util = require("awful.util") @@ -20,15 +23,13 @@ local capi = --- Root window image display library module("telak") -command = "wget -q -O " - local data = otable() -- Update a telak wibox. -- @param w The wibox to update. local function update(w) local tmp = os.tmpname() - os.execute(command .. tmp .. " '" .. data[w].image .. "'") + http.request{url = data[w].image, sink = ltn12.sink.file(io.open(tmp, "w"))} local img = capi.image(tmp) if img then w:geometry({ width = img.width, height = img.height })