revert #9; discouraging #21 and #22 situations

This commit is contained in:
luke bonham 2014-01-21 15:42:33 +01:00 committed by copycat-killer
parent 8dab1614a3
commit a33a8afae0
2 changed files with 3 additions and 15 deletions

View File

@ -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

View File

@ -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()