From: luke bonham Date: Sun, 8 Sep 2013 17:19:41 +0000 (+0200) Subject: some other space fixes X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/52a50fafa078c4fb715c7d274d875ff37e6d96f8 some other space fixes --- diff --git a/widgets/calendar.lua b/widgets/calendar.lua index 38b4d8b..e5f6e88 100644 --- a/widgets/calendar.lua +++ b/widgets/calendar.lua @@ -23,7 +23,7 @@ local setmetatable = setmetatable local calendar = {} local notification = nil -local function create(background, foreground) +local function create(foreground, background) calendar.offset = 0 calendar.icons_dir = icons_dir .. "cal/white/" -- default calendar.notify_icon = nil @@ -111,8 +111,8 @@ function calendar:show(t_out, inc_offset) timeout = tims }) end -function calendar:attach(widget, background, foreground) - create(background, foreground) +function calendar:attach(widget, foreground, background) + create(foreground, background) widget:connect_signal("mouse::enter", function () calendar:show() end) widget:connect_signal("mouse::leave", function () calendar:hide() end) widget:buttons(awful.util.table.join( awful.button({ }, 1, function () diff --git a/widgets/cpu.lua b/widgets/cpu.lua index cf0b76c..3890e5e 100644 --- a/widgets/cpu.lua +++ b/widgets/cpu.lua @@ -32,7 +32,7 @@ function worker(args) local header = args.header or " Cpu " local header_color = args.header or beautiful.fg_normal or "#FFFFFF" local color = args.color or beautiful.fg_focus or "#FFFFFF" - local footer = args.footer or "%" + local footer = args.footer or "% " local w = wibox.widget.textbox() @@ -62,7 +62,7 @@ function worker(args) local dtotal = total - cpu.last_total local dta = math.ceil((dactive / dtotal) * 100) - w:set_markup(markup(header_color, header) .. markup(color, dta .. footer) .. " ") + w:set_markup(markup(header_color, header) .. markup(color, dta .. footer)) -- Save current data for the next run. cpu.last_active = active diff --git a/widgets/fs.lua b/widgets/fs.lua index 283771f..344bd87 100644 --- a/widgets/fs.lua +++ b/widgets/fs.lua @@ -57,7 +57,7 @@ local function worker(args) local header = args.header or " Hdd " local header_color = args.header_color or beautiful.fg_normal or "#FFFFFF" fs.color = args.color or beautiful.fg_focus or "#FFFFFF" - local footer = args.footer or "" + local footer = args.footer or " " local shadow = args.shadow or false local myfs = wibox.widget.textbox() diff --git a/widgets/imap.lua b/widgets/imap.lua index 5f8667d..f06660b 100644 --- a/widgets/imap.lua +++ b/widgets/imap.lua @@ -33,7 +33,7 @@ function worker(args) local port = args.port or "993" local refresh_timeout = args.refresh_timeout or 60 - local header = args.header or " Mail " + local header = args.header or "Mail " local header_color = args.header_color or beautiful.fg_normal or "#FFFFFF" local color = args.color or beautiful.fg_focus or "#FFFFFF" local mail_encoding = args.mail_encoding or nil @@ -96,7 +96,7 @@ function worker(args) elseif ws:find("CheckMailError: invalid credentials") ~= nil then helpers.set_map(mail, true) - myimapcheck:set_markup(markup(header_color, header) .. + myimapcheck:set_markup(" " .. markup(header_color, header) .. markup(color, "invalid credentials ")) else mailcount = ws:match("%d") or "?" @@ -107,7 +107,7 @@ function worker(args) helpers.set_map(mail .. " count", mailcount) end - myimapcheck:set_markup(markup(header_color, header) .. + myimapcheck:set_markup(" " .. markup(header_color, header) .. markup(color, mailcount) .. " ") if helpers.get_map(mail) diff --git a/widgets/maildir.lua b/widgets/maildir.lua index b5437bd..98de091 100644 --- a/widgets/maildir.lua +++ b/widgets/maildir.lua @@ -108,7 +108,7 @@ function worker(args) myimapcheck:set_markup(markup(color_nomail, " no mail ")) end else - myimapcheck:set_markup(markup(header_color, header) .. + myimapcheck:set_markup(" " .. markup(header_color, header) .. markup(color_newmail, newmail) .. " ") end end diff --git a/widgets/mem.lua b/widgets/mem.lua index 09be00f..3034e89 100644 --- a/widgets/mem.lua +++ b/widgets/mem.lua @@ -35,7 +35,7 @@ function worker(args) local header = args.header or " Mem " local header_color = args.header or beautiful.fg_normal or "#FFFFFF" local color = args.color or beautiful.fg_focus or "#FFFFFF" - local footer = args.footer or "MB" + local footer = args.footer or "MB " local widg = wibox.widget.textbox() @@ -62,17 +62,17 @@ function worker(args) then local fmt = "%" .. string.len(mem.total) .. ".0f/%.0f" widg:set_markup(markup(header_color, header) .. - markup(color, string.format(fmt, used, mem.total) .. footer .. " ")) + markup(color, string.format(fmt, used, mem.total) .. footer)) else widg:set_markup(markup(header_color, header) .. - markup(color, used .. footer .. " ")) + markup(color, used .. footer)) end if show_swap then widg:set_markup(widg._layout.text .. ' (' .. string.format('%.0f '.. footer, swapused) - .. ') ') + .. ')') end end diff --git a/widgets/mpd.lua b/widgets/mpd.lua index 9a9c28e..8db62ae 100644 --- a/widgets/mpd.lua +++ b/widgets/mpd.lua @@ -36,6 +36,7 @@ function worker(args) local header_color = args.header_color or beautiful.fg_normal or "#FFFFFF" local color = args.color or beautiful.fg_focus or "#FFFFFF" local spr = args.spr or " " + local footer = args.footer or "" local app = args.app or "ncmpcpp" local shadow = args.shadow or false @@ -53,7 +54,7 @@ function worker(args) then mympd:set_text('') else - mympd:set_markup(markup(header_color, " mpd "), markup(color , "off ")) + mympd:set_markup(markup(header_color, "mpd ") .. markup(color , "off") .. footer) end end @@ -102,14 +103,14 @@ function worker(args) replaces_id = mpd.id }).id end - mympd:set_markup(markup(header_color, " " .. mpd_state["{Artist}"]) + mympd:set_markup(markup(header_color, mpd_state["{Artist}"]) .. spr .. - markup(color, mpd_state["{Title}"] .. " ")) + markup(color, mpd_state["{Title}"]) .. footer) elseif mpd_state["{state}"] == "pause" then - mympd:set_markup(markup(header_color, " mpd") + mympd:set_markup(markup(header_color, "mpd") .. spr .. - markup(color, "paused ")) + markup(color, "paused") .. footer) else helpers.set_map("current mpd track", nil) set_nompd()