Skip to content

Commit

Permalink
revert #9; discouraging #21 and #22 situations
Browse files Browse the repository at this point in the history
  • Loading branch information
luke bonham authored and copycat-killer committed Aug 5, 2015
1 parent 8dab161 commit a33a8af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
16 changes: 2 additions & 14 deletions widgets/mpd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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('')

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion widgets/yawn/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit a33a8af

Please sign in to comment.