From: luke bonham Date: Tue, 21 Jan 2014 14:42:33 +0000 (+0100) Subject: revert #9; discouraging #21 and #22 situations X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/cbb144a79e8c4c243ac0b56d90945652a21e8db9?ds=sidebyside;hp=-c revert #9; discouraging #21 and #22 situations --- cbb144a79e8c4c243ac0b56d90945652a21e8db9 diff --git a/widgets/mpd.lua b/widgets/mpd.lua index 36c3ed7..1749b57 100644 --- a/widgets/mpd.lua +++ b/widgets/mpd.lua @@ -38,19 +38,7 @@ local function worker(args) local mpdcover = helpers.scripts_dir .. "mpdcover" local mpdh = "telnet://" .. host .. ":" .. port - - local echo = nil - - if password == "" then - echo = "(echo -e 'status'; sleep 0.1;" .. - "echo -e 'currentsong'; sleep 0.1;" .. - "echo -e 'close')" - else - echo = "(echo -e 'password " .. password .. "'" .. - "echo -e 'status'; sleep 0.1;" .. - "echo -e 'currentsong'; sleep 0.1;" .. - "echo -e 'close')" - end + local echo = "echo 'password " .. password .. "\nstatus\ncurrentsong\nclose'" mpd.widget = wibox.widget.textbox('') @@ -71,7 +59,7 @@ local function worker(args) date = "N/A" } - local f = io.popen(echo .. " | curl --connect-timeout 1 -fsm 1 " .. mpdh) + local f = io.popen(echo .. " | curl --connect-timeout 1 -fsm 3 " .. mpdh) for line in f:lines() do for k, v in string.gmatch(line, "([%w]+):[%s](.*)$") do diff --git a/widgets/yawn/init.lua b/widgets/yawn/init.lua index a2f756e..36cdf54 100644 --- a/widgets/yawn/init.lua +++ b/widgets/yawn/init.lua @@ -46,7 +46,7 @@ yawn_notification_preset = {} local function fetch_weather() local url = api_url .. units_set .. city_id - local f = io.popen("curl --connect-timeout 1 -fsm 1 '" .. url .. "'" ) + local f = io.popen("curl --connect-timeout 1 -fsm 3 '" .. url .. "'" ) local text = f:read("*all") f:close()