From: luke bonham Date: Fri, 3 Jul 2015 10:17:31 +0000 (+0200) Subject: whitespaces cleaning X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/e1450f8828c1be4e290cec0a34538ebe6cb86b50?ds=sidebyside;hp=--cc;pf=etc whitespaces cleaning --- e1450f8828c1be4e290cec0a34538ebe6cb86b50 diff --git a/helpers.lua b/helpers.lua index 9c4a83f..dbee617 100644 --- a/helpers.lua +++ b/helpers.lua @@ -43,12 +43,12 @@ function helpers.file_exists(file) return f ~= nil end --- get all lines from a file, returns an empty +-- get all lines from a file, returns an empty -- list/table if the file does not exist function helpers.lines_from(file) if not helpers.file_exists(file) then return {} end lines = {} - for line in io.lines(file) do + for line in io.lines(file) do lines[#lines + 1] = line end return lines @@ -64,7 +64,7 @@ end -- returns nil otherwise function helpers.first_nonempty_line(file) for k,v in pairs(helpers.lines_from(file)) do - if #v then return v end + if #v then return v end end return nil end diff --git a/layout/centerfair.lua b/layout/centerfair.lua index 67462f7..1e8915d 100644 --- a/layout/centerfair.lua +++ b/layout/centerfair.lua @@ -90,7 +90,7 @@ function centerfair.arrange(p) -- Master client deserves a special treatement local g = {} - g.width = wa.width - (num_x - 1) * width - num_x * 2*useless_gap - 2 + g.width = wa.width - (num_x - 1) * width - num_x * 2*useless_gap - 2 g.height = wa.height - 2*useless_gap - 2 g.x = offset_x + useless_gap + global_border g.y = offset_y + global_border diff --git a/layout/uselessfair.lua b/layout/uselessfair.lua index ee3aa40..e1284e0 100644 --- a/layout/uselessfair.lua +++ b/layout/uselessfair.lua @@ -1,12 +1,12 @@ --[[ - - Licensed under GNU General Public License v2 - * (c) 2014, projektile, worron - * (c) 2013, Luke Bonham - * (c) 2012, Josh Komoroske - * (c) 2010-2012, Peter Hofmann - + + Licensed under GNU General Public License v2 + * (c) 2014, projektile, worron + * (c) 2013, Luke Bonham + * (c) 2012, Josh Komoroske + * (c) 2010-2012, Peter Hofmann + --]] local beautiful = require("beautiful") diff --git a/layout/uselesspiral.lua b/layout/uselesspiral.lua index ba63bca..c388961 100644 --- a/layout/uselesspiral.lua +++ b/layout/uselesspiral.lua @@ -2,10 +2,10 @@ --[[ Licensed under GNU General Public License v2 - * (c) 2014 projektile - * (c) 2013 Luke Bonham - * (c) 2009 Uli Schlachter - * (c) 2008 Julien Danjolu + * (c) 2014, projektile + * (c) 2013, Luke Bonham + * (c) 2009, Uli Schlachter + * (c) 2008, Julien Danjolu --]] diff --git a/layout/uselesstile.lua b/layout/uselesstile.lua index 877fad1..e48c85d 100644 --- a/layout/uselesstile.lua +++ b/layout/uselesstile.lua @@ -1,12 +1,12 @@ --[[ - - Licensed under GNU General Public License v2 - * (c) 2014 projektile, worron - * (c) 2013 Luke Bonham - * (c) 2009 Donald Ephraim Curtis - * (c) 2008 Julien Danjolu - + + Licensed under GNU General Public License v2 + * (c) 2014, projektile, worron + * (c) 2013, Luke Bonham + * (c) 2009, Donald Ephraim Curtis + * (c) 2008, Julien Danjolu + --]] local tag = require("awful.tag") diff --git a/util/separators.lua b/util/separators.lua index d2a3891..6e5ef96 100644 --- a/util/separators.lua +++ b/util/separators.lua @@ -2,8 +2,8 @@ --[[ Licensed under GNU General Public License v2 - * (c) 2015, Luke Bonham - * (c) 2015, plotnikovanton + * (c) 2015, Luke Bonham + * (c) 2015, plotnikovanton --]] diff --git a/widgets/abase.lua b/widgets/abase.lua index 075d615..8ffdf0e 100644 --- a/widgets/abase.lua +++ b/widgets/abase.lua @@ -12,7 +12,7 @@ local wibox = require("wibox") local setmetatable = setmetatable --- Basic template for custom widgets +-- Basic template for custom widgets -- Asynchronous version -- lain.widgets.abase diff --git a/widgets/calendar.lua b/widgets/calendar.lua index cc0ebe7..3e65f38 100644 --- a/widgets/calendar.lua +++ b/widgets/calendar.lua @@ -37,7 +37,7 @@ function calendar:show(t_out, inc_offset, scr) local tims = t_out or 0 local f, c_text local today = tonumber(os.date('%d')) - local init_t = calendar.cal .. ' ' .. calendar.post_cal .. ' ' .. + local init_t = calendar.cal .. ' ' .. calendar.post_cal .. ' ' .. ' | sed -r -e "s/_\\x08//g" | sed -r -e "s/(^| )(' calendar.offset = calendar.offset + offs @@ -77,7 +77,7 @@ function calendar:show(t_out, inc_offset, scr) calendar.notify_icon = nil - f = io.popen(calendar.cal .. ' ' .. month .. ' ' .. year .. ' ' .. + f = io.popen(calendar.cal .. ' ' .. month .. ' ' .. year .. ' ' .. calendar.post_cal) end diff --git a/widgets/contrib/moc.lua b/widgets/contrib/moc.lua index 84c618b..cfdbec7 100644 --- a/widgets/contrib/moc.lua +++ b/widgets/contrib/moc.lua @@ -1,9 +1,9 @@ --[[ - - Licensed under GNU General Public License v2 - * (c) 2014, anticlockwise - + + Licensed under GNU General Public License v2 + * (c) 2014, anticlockwise + --]] local helpers = require("lain.helpers") diff --git a/widgets/contrib/redshift.lua b/widgets/contrib/redshift.lua index 38f1d83..5ed9300 100644 --- a/widgets/contrib/redshift.lua +++ b/widgets/contrib/redshift.lua @@ -1,25 +1,25 @@ --[[ - - Licensed under GNU General Public License v2 - * (c) 2014, blueluke - + + Licensed under GNU General Public License v2 + * (c) 2014, blueluke + --]] -local os = os -local awful = require("awful") -local spawn = awful.util.spawn_with_shell +local awful = require("awful") +local os = os +local spawn = awful.util.spawn_with_shell local setmetatable = setmetatable --- redshift +-- Redshift -- lain.widgets.contrib.redshift local redshift = {} -local attached = false -- true if attached to a widget -local active = false -- true if redshift is active -local running = false -- true if redshift was initialized -local update_fnct = function() end -- function that is run each time redshift is toggled. See redshift:attach(). +local attached = false -- true if attached to a widget +local active = false -- true if redshift is active +local running = false -- true if redshift was initialized +local update_fnct = function() end -- Function that is run each time redshift is toggled. See redshift:attach(). local function init() @@ -35,11 +35,11 @@ local function init() end function redshift:toggle() - if running then + if running then -- Sending -USR1 toggles redshift (See project website) os.execute("pkill -USR1 redshift") active = not active - else + else init() end update_fnct() @@ -63,9 +63,9 @@ end -- Attach to a widget -- Provides a button which toggles redshift on/off on click --- @ param widget: widget to attach to --- @ param fnct: function to be run each time redshift is toggled (optional). --- Use it to update widget text or icons on status change. +-- @param widget: Widget to attach to. +-- @param fnct: Function to be run each time redshift is toggled (optional). +-- Use it to update widget text or icons on status change. function redshift:attach(widget, fnct) update_fnct = fnct or function() end if not attached then diff --git a/widgets/contrib/task.lua b/widgets/contrib/task.lua index 2e30cdc..6425926 100644 --- a/widgets/contrib/task.lua +++ b/widgets/contrib/task.lua @@ -59,7 +59,7 @@ function task:prompt_add() mypromptbox[mouse.screen].widget, function (...) local f = io.popen("task add " .. ...) - c_text = "\n" .. f:read("*all") @@ -94,7 +94,7 @@ function task:prompt_search() c_text = "" - .. c_text + .. c_text .. "" end