]> git.madduck.net Git - etc/awesome.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

#121: io.read abbreviations removed
authorluke bonham <dada@archlinux.info>
Sat, 25 Jul 2015 22:59:23 +0000 (00:59 +0200)
committercopycat-killer <dada@archlinux.info>
Wed, 5 Aug 2015 11:31:16 +0000 (13:31 +0200)
12 files changed:
widgets/abase.lua
widgets/alsa.lua
widgets/alsabar.lua
widgets/base.lua
widgets/calendar.lua
widgets/fs.lua
widgets/imap.lua
widgets/maildir.lua
widgets/net.lua
widgets/sysload.lua
widgets/temp.lua
widgets/weather.lua

index 8ffdf0ef052fb48b4608e1ea8d47d4e5f23c3509..1c132cd9decfc211c5a255ea7fb41812fc4ffe7e 100644 (file)
@@ -27,7 +27,7 @@ local function worker(args)
 
     function abase.update()
         async.request(cmd, function(f)
 
     function abase.update()
         async.request(cmd, function(f)
-            output = f:read("*a")
+            output = f:read("*all")
             f:close()
             widget = abase.widget
             settings()
             f:close()
             widget = abase.widget
             settings()
index 979d9fd106470025942e650e99ac4e172d714fed..91bf488290b7824a7b651f99f00f1098bb869546 100644 (file)
@@ -33,7 +33,7 @@ local function worker(args)
 
     function alsa.update()
         local f = assert(io.popen(string.format("%s get %s", alsa.cmd, alsa.channel)))
 
     function alsa.update()
         local f = assert(io.popen(string.format("%s get %s", alsa.cmd, alsa.channel)))
-        local mixer = f:read("*a")
+        local mixer = f:read("*all")
         f:close()
 
         volume_now = {}
         f:close()
 
         volume_now = {}
index 2cf1c2957042eea7fce1b55883417231b7b0893d..5fe74c4ca27f9cde70ad41b5d32ac78be8dc21d1 100644 (file)
@@ -117,7 +117,7 @@ local function worker(args)
     function alsabar.update()
         -- Get mixer control contents
         local f = assert(io.popen(string.format("%s get %s", alsabar.cmd, alsabar.channel)))
     function alsabar.update()
         -- Get mixer control contents
         local f = assert(io.popen(string.format("%s get %s", alsabar.cmd, alsabar.channel)))
-        local mixer = f:read("*a")
+        local mixer = f:read("*all")
         f:close()
 
         -- Capture mixer control state:          [5%] ... ... [on]
         f:close()
 
         -- Capture mixer control state:          [5%] ... ... [on]
index 39b0863e4dfbf8ba1b01ea751d9520d1b2977330..2a7bf1027545bcc32a1be73dbb7ebaa502a292ba 100644 (file)
@@ -26,7 +26,7 @@ local function worker(args)
 
     function base.update()
         local f = assert(io.popen(cmd))
 
     function base.update()
         local f = assert(io.popen(cmd))
-        output = f:read("*a")
+        output = f:read("*all")
         f:close()
         widget = base.widget
         settings()
         f:close()
         widget = base.widget
         settings()
index 3e65f38bb8596e8114cb2071c92d814f72a8649f..2df2f0594ca8e1706999cb462e1f2c1acde54a70 100644 (file)
@@ -85,7 +85,7 @@ function calendar:show(t_out, inc_offset, scr)
              .. calendar.font_size .. "'><b>"
              .. f:read() .. "</b>\n\n"
              .. f:read() .. "\n"
              .. calendar.font_size .. "'><b>"
              .. f:read() .. "</b>\n\n"
              .. f:read() .. "\n"
-             .. f:read("*a"):gsub("\n*$", "")
+             .. f:read("*all"):gsub("\n*$", "")
              .. "</span></tt>"
     f:close()
 
              .. "</span></tt>"
     f:close()
 
index 951f0cce98b98e0ba5187f40bf7fc2ca30ade4cd..07490faa905cad335220b23bce4fd296bbc44bba 100644 (file)
@@ -40,7 +40,7 @@ function fs:show(t_out)
     fs:hide()
 
     local f = io.popen(helpers.scripts_dir .. "dfs")
     fs:hide()
 
     local f = io.popen(helpers.scripts_dir .. "dfs")
-    ws = f:read("*a"):gsub("\n*$", "")
+    ws = f:read("*all"):gsub("\n*$", "")
     f:close()
 
     notification = naughty.notify({
     f:close()
 
     notification = naughty.notify({
index 1ebbb76da6af266608813aecd162fa976b4e2410..ea62cc7053e27e0471c2496df09887c1fd47bf2e 100644 (file)
@@ -42,7 +42,7 @@ local function worker(args)
     if not is_plain
     then
         local f = io.popen(password)
     if not is_plain
     then
         local f = io.popen(password)
-        password = f:read("*a"):gsub("\n", "")
+        password = f:read("*all"):gsub("\n", "")
         f:close()
     end
 
         f:close()
     end
 
@@ -58,7 +58,7 @@ local function worker(args)
                head_command, server, port, mail, password, request)
 
         async.request(curl, function(f)
                head_command, server, port, mail, password, request)
 
         async.request(curl, function(f)
-            ws = f:read("*a")
+            ws = f:read("*all")
             f:close()
 
             _, mailcount = string.gsub(ws, "%d+", "")
             f:close()
 
             _, mailcount = string.gsub(ws, "%d+", "")
index 246341f98962b5d352a408ccb954738b2bf35665..315ae34a819d8f82011cb0821d1772199db8a979 100644 (file)
@@ -53,7 +53,7 @@ local function worker(args)
                 local np = io.popen("find " .. line ..
                                     "/new -mindepth 1 -type f " ..
                                     "-not -name '.*' -printf a")
                 local np = io.popen("find " .. line ..
                                     "/new -mindepth 1 -type f " ..
                                     "-not -name '.*' -printf a")
-                local mailstring = np:read("*a")
+                local mailstring = np:read("*all")
 
                 -- Strip off leading mailpath.
                 local box = string.match(line, mailpath .. "/*([^/]+)")
 
                 -- Strip off leading mailpath.
                 local box = string.match(line, mailpath .. "/*([^/]+)")
index 2585ad4b4e083372c7e8aee7596c93e711a9874e..d859d911123ad9dc575ac77a7697739c01baea56 100644 (file)
@@ -29,7 +29,7 @@ local net = {
 
 function net.get_device()
     f = io.popen("ip link show | cut -d' ' -f2,9")
 
 function net.get_device()
     f = io.popen("ip link show | cut -d' ' -f2,9")
-    ws = f:read("*a")
+    ws = f:read("*all")
     f:close()
     ws = ws:match("%w+: UP") or ws:match("ppp%w+: UNKNOWN")
     if ws ~= nil then
     f:close()
     ws = ws:match("%w+: UP") or ws:match("ppp%w+: UNKNOWN")
     if ws ~= nil then
index b10c5e2300ec5737a97f5484610dc4e61944517e..d8e4713a77371088c2ac14693b1183b97ef4517a 100644 (file)
@@ -29,7 +29,7 @@ local function worker(args)
 
     function update()
         local f = io.open("/proc/loadavg")
 
     function update()
         local f = io.open("/proc/loadavg")
-        local ret = f:read("*a")
+        local ret = f:read("*all")
         f:close()
 
         load_1, load_5, load_15 = string.match(ret, "([^%s]+) ([^%s]+) ([^%s]+)")
         f:close()
 
         load_1, load_5, load_15 = string.match(ret, "([^%s]+) ([^%s]+) ([^%s]+)")
index 1e93848e0419c9a0e993ec9389608dad7161d44b..67c94560b9a58e67fa15ef340c8862f4b473e020 100644 (file)
@@ -31,7 +31,7 @@ local function worker(args)
         local f = io.open(tempfile)
         if f ~= nil
         then
         local f = io.open(tempfile)
         if f ~= nil
         then
-            coretemp_now = tonumber(f:read("*a")) / 1000
+            coretemp_now = tonumber(f:read("*all")) / 1000
             f:close()
         else
             coretemp_now = "N/A"
             f:close()
         else
             coretemp_now = "N/A"
index 559d4d265d0cb5b562f491f3b24820b7eb5ddf55..53ae8383d379a026166b6321b0a57aa9d92f7008 100644 (file)
@@ -71,7 +71,7 @@ local function worker(args)
     function weather.forecast_update()
         local cmd = string.format(forecast_call, city_id, units, lang, cnt)
         async.request(cmd, function(f)
     function weather.forecast_update()
         local cmd = string.format(forecast_call, city_id, units, lang, cnt)
         async.request(cmd, function(f)
-            j = f:read("*a")
+            j = f:read("*all")
             f:close()
             weather_now, pos, err = json.decode(j, 1, nil)
 
             f:close()
             weather_now, pos, err = json.decode(j, 1, nil)
 
@@ -79,7 +79,7 @@ local function worker(args)
                 weather.notification_text = ''
                 for i = 1, weather_now["cnt"] do
                     local f = assert(io.popen(string.format(date_cmd, weather_now["list"][i]["dt"])))
                 weather.notification_text = ''
                 for i = 1, weather_now["cnt"] do
                     local f = assert(io.popen(string.format(date_cmd, weather_now["list"][i]["dt"])))
-                    day = string.gsub(f:read("*a"), "\n", "")
+                    day = string.gsub(f:read("*all"), "\n", "")
                     f:close()
 
                     tmin = math.floor(weather_now["list"][i]["temp"]["min"])
                     f:close()
 
                     tmin = math.floor(weather_now["list"][i]["temp"]["min"])
@@ -103,7 +103,7 @@ local function worker(args)
     function weather.update()
         local cmd = string.format(current_call, city_id, units, lang)
         async.request(cmd, function(f)
     function weather.update()
         local cmd = string.format(current_call, city_id, units, lang)
         async.request(cmd, function(f)
-            j = f:read("*a")
+            j = f:read("*all")
             f:close()
             weather_now, pos, err = json.decode(j, 1, nil)
 
             f:close()
             weather_now, pos, err = json.decode(j, 1, nil)