whitespaces cleaning

This commit is contained in:
luke bonham 2015-07-03 12:17:31 +02:00 committed by copycat-killer
parent 33ee32b4d1
commit 973b56ce0b
11 changed files with 50 additions and 50 deletions

View File

@ -43,12 +43,12 @@ function helpers.file_exists(file)
return f ~= nil return f ~= nil
end 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 -- list/table if the file does not exist
function helpers.lines_from(file) function helpers.lines_from(file)
if not helpers.file_exists(file) then return {} end if not helpers.file_exists(file) then return {} end
lines = {} lines = {}
for line in io.lines(file) do for line in io.lines(file) do
lines[#lines + 1] = line lines[#lines + 1] = line
end end
return lines return lines
@ -64,7 +64,7 @@ end
-- returns nil otherwise -- returns nil otherwise
function helpers.first_nonempty_line(file) function helpers.first_nonempty_line(file)
for k,v in pairs(helpers.lines_from(file)) do for k,v in pairs(helpers.lines_from(file)) do
if #v then return v end if #v then return v end
end end
return nil return nil
end end

View File

@ -90,7 +90,7 @@ function centerfair.arrange(p)
-- Master client deserves a special treatement -- Master client deserves a special treatement
local g = {} 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.height = wa.height - 2*useless_gap - 2
g.x = offset_x + useless_gap + global_border g.x = offset_x + useless_gap + global_border
g.y = offset_y + global_border g.y = offset_y + global_border

View File

@ -1,12 +1,12 @@
--[[ --[[
Licensed under GNU General Public License v2 Licensed under GNU General Public License v2
* (c) 2014, projektile, worron * (c) 2014, projektile, worron
* (c) 2013, Luke Bonham * (c) 2013, Luke Bonham
* (c) 2012, Josh Komoroske * (c) 2012, Josh Komoroske
* (c) 2010-2012, Peter Hofmann * (c) 2010-2012, Peter Hofmann
--]] --]]
local beautiful = require("beautiful") local beautiful = require("beautiful")

View File

@ -2,10 +2,10 @@
--[[ --[[
Licensed under GNU General Public License v2 Licensed under GNU General Public License v2
* (c) 2014 projektile * (c) 2014, projektile
* (c) 2013 Luke Bonham * (c) 2013, Luke Bonham
* (c) 2009 Uli Schlachter * (c) 2009, Uli Schlachter
* (c) 2008 Julien Danjolu * (c) 2008, Julien Danjolu
--]] --]]

View File

@ -1,12 +1,12 @@
--[[ --[[
Licensed under GNU General Public License v2 Licensed under GNU General Public License v2
* (c) 2014 projektile, worron * (c) 2014, projektile, worron
* (c) 2013 Luke Bonham * (c) 2013, Luke Bonham
* (c) 2009 Donald Ephraim Curtis * (c) 2009, Donald Ephraim Curtis
* (c) 2008 Julien Danjolu * (c) 2008, Julien Danjolu
--]] --]]
local tag = require("awful.tag") local tag = require("awful.tag")

View File

@ -2,8 +2,8 @@
--[[ --[[
Licensed under GNU General Public License v2 Licensed under GNU General Public License v2
* (c) 2015, Luke Bonham * (c) 2015, Luke Bonham
* (c) 2015, plotnikovanton * (c) 2015, plotnikovanton
--]] --]]

View File

@ -12,7 +12,7 @@ local wibox = require("wibox")
local setmetatable = setmetatable local setmetatable = setmetatable
-- Basic template for custom widgets -- Basic template for custom widgets
-- Asynchronous version -- Asynchronous version
-- lain.widgets.abase -- lain.widgets.abase

View File

@ -37,7 +37,7 @@ function calendar:show(t_out, inc_offset, scr)
local tims = t_out or 0 local tims = t_out or 0
local f, c_text local f, c_text
local today = tonumber(os.date('%d')) 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/(^| )(' ' | sed -r -e "s/_\\x08//g" | sed -r -e "s/(^| )('
calendar.offset = calendar.offset + offs calendar.offset = calendar.offset + offs
@ -77,7 +77,7 @@ function calendar:show(t_out, inc_offset, scr)
calendar.notify_icon = nil calendar.notify_icon = nil
f = io.popen(calendar.cal .. ' ' .. month .. ' ' .. year .. ' ' .. f = io.popen(calendar.cal .. ' ' .. month .. ' ' .. year .. ' ' ..
calendar.post_cal) calendar.post_cal)
end end

View File

@ -1,9 +1,9 @@
--[[ --[[
Licensed under GNU General Public License v2 Licensed under GNU General Public License v2
* (c) 2014, anticlockwise <http://github.com/anticlockwise> * (c) 2014, anticlockwise <http://github.com/anticlockwise>
--]] --]]
local helpers = require("lain.helpers") local helpers = require("lain.helpers")

View File

@ -1,25 +1,25 @@
--[[ --[[
Licensed under GNU General Public License v2 Licensed under GNU General Public License v2
* (c) 2014, blueluke <http://github.com/blueluke> * (c) 2014, blueluke <http://github.com/blueluke>
--]] --]]
local os = os local awful = require("awful")
local awful = require("awful") local os = os
local spawn = awful.util.spawn_with_shell local spawn = awful.util.spawn_with_shell
local setmetatable = setmetatable local setmetatable = setmetatable
-- redshift -- Redshift
-- lain.widgets.contrib.redshift -- lain.widgets.contrib.redshift
local redshift = {} local redshift = {}
local attached = false -- true if attached to a widget local attached = false -- true if attached to a widget
local active = false -- true if redshift is active local active = false -- true if redshift is active
local running = false -- true if redshift was initialized 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 update_fnct = function() end -- Function that is run each time redshift is toggled. See redshift:attach().
local function init() local function init()
@ -35,11 +35,11 @@ local function init()
end end
function redshift:toggle() function redshift:toggle()
if running then if running then
-- Sending -USR1 toggles redshift (See project website) -- Sending -USR1 toggles redshift (See project website)
os.execute("pkill -USR1 redshift") os.execute("pkill -USR1 redshift")
active = not active active = not active
else else
init() init()
end end
update_fnct() update_fnct()
@ -63,9 +63,9 @@ end
-- Attach to a widget -- Attach to a widget
-- Provides a button which toggles redshift on/off on click -- Provides a button which toggles redshift on/off on click
-- @ param widget: widget to attach to -- @param widget: Widget to attach to.
-- @ param fnct: function to be run each time redshift is toggled (optional). -- @param fnct: Function to be run each time redshift is toggled (optional).
-- Use it to update widget text or icons on status change. -- Use it to update widget text or icons on status change.
function redshift:attach(widget, fnct) function redshift:attach(widget, fnct)
update_fnct = fnct or function() end update_fnct = fnct or function() end
if not attached then if not attached then

View File

@ -59,7 +59,7 @@ function task:prompt_add()
mypromptbox[mouse.screen].widget, mypromptbox[mouse.screen].widget,
function (...) function (...)
local f = io.popen("task add " .. ...) local f = io.popen("task add " .. ...)
c_text = "\n<span font='" c_text = "\n<span font='"
.. task.font .. " " .. task.font .. " "
.. task.font_size .. "'>" .. task.font_size .. "'>"
.. f:read("*all") .. f:read("*all")
@ -94,7 +94,7 @@ function task:prompt_search()
c_text = "<span font='" c_text = "<span font='"
.. task.font .. " " .. task.font .. " "
.. task.font_size .. "'>" .. task.font_size .. "'>"
.. c_text .. c_text
.. "</span>" .. "</span>"
end end