mirror of https://github.com/lcpz/lain.git
whitespaces cleaning
This commit is contained in:
parent
95c019cb25
commit
e1450f8828
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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
|
||||
|
||||
--]]
|
||||
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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
|
||||
|
||||
--]]
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
|
||||
--[[
|
||||
|
||||
Licensed under GNU General Public License v2
|
||||
* (c) 2014, anticlockwise <http://github.com/anticlockwise>
|
||||
|
||||
|
||||
Licensed under GNU General Public License v2
|
||||
* (c) 2014, anticlockwise <http://github.com/anticlockwise>
|
||||
|
||||
--]]
|
||||
|
||||
local helpers = require("lain.helpers")
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
|
||||
--[[
|
||||
|
||||
Licensed under GNU General Public License v2
|
||||
* (c) 2014, blueluke <http://github.com/blueluke>
|
||||
|
||||
|
||||
Licensed under GNU General Public License v2
|
||||
* (c) 2014, blueluke <http://github.com/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
|
||||
|
|
|
@ -59,7 +59,7 @@ function task:prompt_add()
|
|||
mypromptbox[mouse.screen].widget,
|
||||
function (...)
|
||||
local f = io.popen("task add " .. ...)
|
||||
c_text = "\n<span font='"
|
||||
c_text = "\n<span font='"
|
||||
.. task.font .. " "
|
||||
.. task.font_size .. "'>"
|
||||
.. f:read("*all")
|
||||
|
@ -94,7 +94,7 @@ function task:prompt_search()
|
|||
c_text = "<span font='"
|
||||
.. task.font .. " "
|
||||
.. task.font_size .. "'>"
|
||||
.. c_text
|
||||
.. c_text
|
||||
.. "</span>"
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue