From d4f59f292c3c499d997323f3c88b860775cad0c8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Manuel=20G=C3=B6rlich?= Date: Wed, 4 Dec 2013 18:52:40 +0100 Subject: [PATCH 01/16] Fix unread count in imap widget --- widgets/imap.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/widgets/imap.lua b/widgets/imap.lua index 87a9e61..39518bd 100644 --- a/widgets/imap.lua +++ b/widgets/imap.lua @@ -62,6 +62,7 @@ local function worker(args) f:close() _, mailcount = string.gsub(ws, "%d+", "") + _ = nil widget = imap.widget settings() -- 2.39.5 From f89991fe26dd904b05f4bac25f71e7d7d45c2206 Mon Sep 17 00:00:00 2001 From: luke bonham Date: Thu, 5 Dec 2013 10:19:16 +0100 Subject: [PATCH 02/16] wiki updated --- wiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiki b/wiki index 65c1a3a..7b6d89c 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 65c1a3ab6e411aec30c3145178fac9f7fdbab87f +Subproject commit 7b6d89cd4ff2b84fd333c8f6a5f0ef079b845f48 -- 2.39.5 From 0bd5a1cdcb18e79b785469c0348a4c50d54864d4 Mon Sep 17 00:00:00 2001 From: yawnt Date: Mon, 23 Dec 2013 17:19:25 +0100 Subject: [PATCH 03/16] contrib-widget: brightness --- widgets/contrib/brightness.lua | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 widgets/contrib/brightness.lua diff --git a/widgets/contrib/brightness.lua b/widgets/contrib/brightness.lua new file mode 100644 index 0000000..bf14baf --- /dev/null +++ b/widgets/contrib/brightness.lua @@ -0,0 +1,46 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2013, yawnt + +--]] + +local newtimer = require("lain.helpers").newtimer + +local wibox = require("wibox") +local io = { popen = io.popen } +local string = { match = string.match } + +local setmetatable = setmetatable + +-- Brightness +-- lain.widgets.contrib.brightness +local brightness = {} + +local function worker(args) + local args = args or {} + local backlight = args.backlight or "acpi_video0" + local timeout = args.timeout or 5 + local settings = args.settings or function() end + + brightness.widget = wibox.widget.textbox('') + + function brightness.update() + local f = assert(io.popen('cat /sys/class/backlight/' .. backlight .. "/brightness")) + + brightness_now = { + level = f:read("*a") + } + f:close() + + widget = brightness.widget + settings() + end + + newtimer("brightness", timeout, brightness.update) + + return setmetatable(brightness, { __index = brightness.widget }) +end + +return setmetatable(brightness, { __call = function(_, ...) return worker(...) end }) -- 2.39.5 From 0345cc3576955b37a981ee8f38d11e99c82dbb31 Mon Sep 17 00:00:00 2001 From: yawnt Date: Mon, 23 Dec 2013 18:04:06 +0100 Subject: [PATCH 04/16] fix: better code --- widgets/contrib/brightness.lua | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/widgets/contrib/brightness.lua b/widgets/contrib/brightness.lua index bf14baf..6967572 100644 --- a/widgets/contrib/brightness.lua +++ b/widgets/contrib/brightness.lua @@ -1,9 +1,9 @@ --[[ - - Licensed under GNU General Public License v2 + + Licensed under GNU General Public License v2 * (c) 2013, yawnt - + --]] local newtimer = require("lain.helpers").newtimer @@ -14,7 +14,7 @@ local string = { match = string.match } local setmetatable = setmetatable --- Brightness +-- Brightness -- lain.widgets.contrib.brightness local brightness = {} @@ -28,12 +28,9 @@ local function worker(args) function brightness.update() local f = assert(io.popen('cat /sys/class/backlight/' .. backlight .. "/brightness")) - - brightness_now = { - level = f:read("*a") - } + brightness_now = f:read("*a") f:close() - + widget = brightness.widget settings() end -- 2.39.5 From f37929e6701328949d199d8c914480c179e2ee2d Mon Sep 17 00:00:00 2001 From: luke bonham Date: Mon, 23 Dec 2013 18:18:33 +0100 Subject: [PATCH 05/16] wiki: new commit --- README.rst | 6 +++--- widgets/contrib/brightness.lua | 10 +++++----- wiki | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.rst b/README.rst index 8eba2fb..07f4ee7 100644 --- a/README.rst +++ b/README.rst @@ -28,11 +28,11 @@ Just make sure that: - Your code its easy to understand, maintainable, and modularized. You should also avoid code duplication wherever possible by adding functions or using ``lain.helpers``. If something is unclear, and you can't write it in such a way that it will be clear, explain it with a comment. -- You test your changes before submitting to make sure that not only your code works, but have not broken other parts of the module too! +- You test your changes before submitting to make sure that not only your code works, but did not break other parts of the module too! -- You update ``wiki`` submodule with a thorough section. +- You eventually update ``wiki`` submodule with a thorough section. -Contributed widgets have to be put it in ``lain/widget/contrib``. +Contributed widgets have to be put in ``lain/widget/contrib``. Screenshots ----------- diff --git a/widgets/contrib/brightness.lua b/widgets/contrib/brightness.lua index 6967572..0ba2f45 100644 --- a/widgets/contrib/brightness.lua +++ b/widgets/contrib/brightness.lua @@ -1,9 +1,9 @@ --[[ - - Licensed under GNU General Public License v2 - * (c) 2013, yawnt - + + Licensed under GNU General Public License v2 + * (c) 2013, yawnt + --]] local newtimer = require("lain.helpers").newtimer @@ -14,7 +14,7 @@ local string = { match = string.match } local setmetatable = setmetatable --- Brightness +-- Brightness level -- lain.widgets.contrib.brightness local brightness = {} diff --git a/wiki b/wiki index 7b6d89c..e379b96 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 7b6d89cd4ff2b84fd333c8f6a5f0ef079b845f48 +Subproject commit e379b9649b88e4e88a95731565e65d92c86b2824 -- 2.39.5 From a8d6e9aa27ba2d8674c4d3ee6c6229469e30539f Mon Sep 17 00:00:00 2001 From: luke bonham Date: Tue, 24 Dec 2013 12:29:37 +0100 Subject: [PATCH 06/16] wiki: some typos fixed --- wiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiki b/wiki index e379b96..9f6ff05 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit e379b9649b88e4e88a95731565e65d92c86b2824 +Subproject commit 9f6ff057f4b99704d9396a66c4f2896954541d2e -- 2.39.5 From fddeeff66466ca8f8bd7d06099eabd1feda10675 Mon Sep 17 00:00:00 2001 From: luke bonham Date: Mon, 30 Dec 2013 19:18:01 +0100 Subject: [PATCH 07/16] yawn: new localization word --- widgets/yawn/localizations/it_IT | 3 ++- widgets/yawn/localizations/localization_template | 3 ++- wiki | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/widgets/yawn/localizations/it_IT b/widgets/yawn/localizations/it_IT index f1bfbe2..70b0eef 100644 --- a/widgets/yawn/localizations/it_IT +++ b/widgets/yawn/localizations/it_IT @@ -50,7 +50,8 @@ Windy|Ventoso Wind|Ventoso Snow|Neve Sleet|Nevischio -Drizzle|Pioggerella +Light Drizzle|Pioggia Leggera +Drizzle|Pioggia Leggera Freezing Drizzle|Pioggerella Congelantesi Hail|Grandine Fog|Nebbia diff --git a/widgets/yawn/localizations/localization_template b/widgets/yawn/localizations/localization_template index e3a948f..453807e 100644 --- a/widgets/yawn/localizations/localization_template +++ b/widgets/yawn/localizations/localization_template @@ -50,8 +50,9 @@ Windy| Wind| Snow| Sleet| -Drizzle| Freezing Drizzle| +Light Drizzle| +Drizzle| Hail| Fog| Foggy| diff --git a/wiki b/wiki index 9f6ff05..c8e07d2 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 9f6ff057f4b99704d9396a66c4f2896954541d2e +Subproject commit c8e07d2ec34cfb12907e4ccb5f29908aa8c98f5a -- 2.39.5 From b7fbde4042a9275e9454acb6e586896319cf1455 Mon Sep 17 00:00:00 2001 From: luke bonham Date: Sat, 4 Jan 2014 12:23:24 +0100 Subject: [PATCH 08/16] #18 fixed --- widgets/temp.lua | 10 ++++++++-- wiki | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/widgets/temp.lua b/widgets/temp.lua index b57c477..b55d52f 100644 --- a/widgets/temp.lua +++ b/widgets/temp.lua @@ -28,8 +28,14 @@ local function worker(args) function update() local f = io.open("/sys/class/thermal/thermal_zone0/temp") - coretemp_now = tonumber(f:read("*all")) / 1000 - f:close() + if f ~= nil + then + coretemp_now = tonumber(f:read("*all")) / 1000 + f:close() + else + coretemp_now = "N/A" + end + widget = temp.widget settings() end diff --git a/wiki b/wiki index c8e07d2..07a230f 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit c8e07d2ec34cfb12907e4ccb5f29908aa8c98f5a +Subproject commit 07a230fb1654cc6abc1bd1ea8b36d8dcb3c1ad62 -- 2.39.5 From 8207714a8b362ecbae1a2a2a676ffb5922a419c2 Mon Sep 17 00:00:00 2001 From: luke bonham Date: Sat, 4 Jan 2014 12:35:16 +0100 Subject: [PATCH 09/16] wiki updated --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 07f4ee7..f59c04d 100644 --- a/README.rst +++ b/README.rst @@ -6,7 +6,7 @@ Layouts, widgets and utilities for Awesome WM --------------------------------------------- :Author: Luke Bonham -:Version: 1.0-git +:Version: git :License: GNU-GPLv2_ :Source: https://github.com/copycat-killer/lain -- 2.39.5 From 28b9a0b91312e080f352c6bde89bbc3718215b30 Mon Sep 17 00:00:00 2001 From: luke bonham Date: Thu, 9 Jan 2014 14:33:18 +0100 Subject: [PATCH 10/16] brigthness: unused lib removed --- widgets/contrib/brightness.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/widgets/contrib/brightness.lua b/widgets/contrib/brightness.lua index 0ba2f45..04b8d2b 100644 --- a/widgets/contrib/brightness.lua +++ b/widgets/contrib/brightness.lua @@ -10,7 +10,6 @@ local newtimer = require("lain.helpers").newtimer local wibox = require("wibox") local io = { popen = io.popen } -local string = { match = string.match } local setmetatable = setmetatable -- 2.39.5 From b521dbdc8b305bc9580fe6a17d847fe5e1e22cd0 Mon Sep 17 00:00:00 2001 From: luke bonham Date: Mon, 13 Jan 2014 13:03:21 +0100 Subject: [PATCH 11/16] pull #19 satisfaction --- widgets/bat.lua | 3 ++- wiki | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/widgets/bat.lua b/widgets/bat.lua index 2906de2..b3f91dd 100644 --- a/widgets/bat.lua +++ b/widgets/bat.lua @@ -27,6 +27,7 @@ local function worker(args) local args = args or {} local timeout = args.timeout or 30 local battery = args.battery or "BAT0" + local notify = args.notify or true local settings = args.settings or function() end bat.widget = wibox.widget.textbox('') @@ -96,7 +97,7 @@ local function worker(args) end -- notifications for low and critical states - if bat_now.status == "Discharging" + if bat_now.status == "Discharging" and notify then if tonumber(bat_now.perc) <= 5 then diff --git a/wiki b/wiki index 07a230f..780ce12 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 07a230fb1654cc6abc1bd1ea8b36d8dcb3c1ad62 +Subproject commit 780ce12033c8aa90c5060280cfbdfd6fddc7584f -- 2.39.5 From 270c5fa6b12aeaa5cfb80716d119424d805e2465 Mon Sep 17 00:00:00 2001 From: luke bonham Date: Tue, 14 Jan 2014 09:46:06 +0100 Subject: [PATCH 12/16] revert to original pull request #19 --- widgets/bat.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/widgets/bat.lua b/widgets/bat.lua index b3f91dd..48a14fb 100644 --- a/widgets/bat.lua +++ b/widgets/bat.lua @@ -27,7 +27,7 @@ local function worker(args) local args = args or {} local timeout = args.timeout or 30 local battery = args.battery or "BAT0" - local notify = args.notify or true + local notify = args.notify or "on" local settings = args.settings or function() end bat.widget = wibox.widget.textbox('') @@ -97,7 +97,7 @@ local function worker(args) end -- notifications for low and critical states - if bat_now.status == "Discharging" and notify + if bat_now.status == "Discharging" and notify == "on" then if tonumber(bat_now.perc) <= 5 then -- 2.39.5 From e0b6dd443ce1895e668313a93939f489fbd2ea05 Mon Sep 17 00:00:00 2001 From: luke bonham Date: Tue, 14 Jan 2014 10:09:57 +0100 Subject: [PATCH 13/16] alsabar: fixed 'ticks' boolean issue; wiki updated --- widgets/alsabar.lua | 5 ++--- wiki | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/widgets/alsabar.lua b/widgets/alsabar.lua index 90d3a0d..365ac2d 100644 --- a/widgets/alsabar.lua +++ b/widgets/alsabar.lua @@ -95,7 +95,7 @@ local function worker(args) local settings = args.settings or function() end local width = args.width or 63 local height = args.heigth or 1 - local ticks = args.ticks or true + local ticks = args.ticks or false local ticks_size = args.ticks_size or 7 local vertical = args.vertical or false @@ -113,8 +113,7 @@ local function worker(args) alsabar.bar:set_height(height) alsabar.bar:set_ticks(ticks) alsabar.bar:set_ticks_size(ticks_size) - - if vertical then alsabar.bar:set_vertical(true) end + alsabar.bar:set_vertical(vertical) function alsabar.update() -- Get mixer control contents diff --git a/wiki b/wiki index 780ce12..41d28b9 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 780ce12033c8aa90c5060280cfbdfd6fddc7584f +Subproject commit 41d28b93ebbeb7e51584032e88c748426ea6cd82 -- 2.39.5 From 48fc17f8cd29d16c20b3bd5f482602dd70c891c5 Mon Sep 17 00:00:00 2001 From: luke bonham Date: Mon, 20 Jan 2014 19:12:00 +0100 Subject: [PATCH 14/16] wiki: improved imap widget section --- wiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiki b/wiki index 41d28b9..ecf143b 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 41d28b93ebbeb7e51584032e88c748426ea6cd82 +Subproject commit ecf143be0d664ce754edeb1ed0ead3bd1104c7e6 -- 2.39.5 From cc739f08e74418d870df1389338cc5ccead57538 Mon Sep 17 00:00:00 2001 From: luke bonham Date: Mon, 20 Jan 2014 19:15:19 +0100 Subject: [PATCH 15/16] wiki: improved imap widget section --- wiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiki b/wiki index ecf143b..f996cdb 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit ecf143be0d664ce754edeb1ed0ead3bd1104c7e6 +Subproject commit f996cdb74e7583534256d82706ef63d2b9811b42 -- 2.39.5 From cbb144a79e8c4c243ac0b56d90945652a21e8db9 Mon Sep 17 00:00:00 2001 From: luke bonham Date: Tue, 21 Jan 2014 15:42:33 +0100 Subject: [PATCH 16/16] revert #9; discouraging #21 and #22 situations --- widgets/mpd.lua | 16 ++-------------- widgets/yawn/init.lua | 2 +- 2 files changed, 3 insertions(+), 15 deletions(-) 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() -- 2.39.5