]>
git.madduck.net Git - etc/awesome.git/commitdiff
madduck's git repository
Every one of the projects in this repository is available at the canonical
URL git://git.madduck.net/madduck/pub/<projectpath> — see
each project's metadata for the exact URL.
All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@ git. madduck. net .
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
SSH access, as well as push access can be individually
arranged .
If you use my repositories frequently, consider adding the following
snippet to ~/.gitconfig and using the third clone URL listed for each
project:
[url "git://git.madduck.net/madduck/"]
insteadOf = madduck:
summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (parent:
33ee32b )
--- 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 = {}
-- 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
lines[#lines + 1] = line
end
return lines
-- returns nil otherwise
function helpers.first_nonempty_line(file)
for k,v in pairs(helpers.lines_from(file)) do
-- 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
-- Master client deserves a special treatement
local g = {}
-- 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
g.height = wa.height - 2*useless_gap - 2
g.x = offset_x + useless_gap + global_border
g.y = offset_y + global_border
-
- 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")
--]]
local beautiful = require("beautiful")
--[[
Licensed under GNU General Public License v2
--[[
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
-
- 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")
--]]
local tag = require("awful.tag")
--[[
Licensed under GNU General Public License v2
--[[
Licensed under GNU General Public License v2
- * (c) 2015, Luke Bonham
- * (c) 2015, plotnikovanton
+ * (c) 2015, Luke Bonham
+ * (c) 2015, plotnikovanton
local setmetatable = setmetatable
local setmetatable = setmetatable
--- Basic template for custom widgets
+-- Basic template for custom widgets
-- Asynchronous version
-- lain.widgets.abase
-- Asynchronous version
-- lain.widgets.abase
local tims = t_out or 0
local f, c_text
local today = tonumber(os.date('%d'))
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
' | sed -r -e "s/_\\x08//g" | sed -r -e "s/(^| )('
calendar.offset = calendar.offset + offs
calendar.notify_icon = nil
calendar.notify_icon = nil
- f = io.popen(calendar.cal .. ' ' .. month .. ' ' .. year .. ' ' ..
+ f = io.popen(calendar.cal .. ' ' .. month .. ' ' .. year .. ' ' ..
-
- 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")
--]]
local helpers = require("lain.helpers")
-
- 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
local setmetatable = setmetatable
-- lain.widgets.contrib.redshift
local 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 -- f unction 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 -- F unction that is run each time redshift is toggled. See redshift:attach().
end
function redshift:toggle()
end
function redshift:toggle()
-- Sending -USR1 toggles redshift (See project website)
os.execute("pkill -USR1 redshift")
active = not active
-- Sending -USR1 toggles redshift (See project website)
os.execute("pkill -USR1 redshift")
active = not active
-- Attach to a widget
-- Provides a button which toggles redshift on/off on click
-- Attach to a widget
-- Provides a button which toggles redshift on/off on click
--- @ param widget: widget to attach to
--- @ param fnct: f unction 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: F unction 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
function redshift:attach(widget, fnct)
update_fnct = fnct or function() end
if not attached then
mypromptbox[mouse.screen].widget,
function (...)
local f = io.popen("task 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")
.. task.font .. " "
.. task.font_size .. "'>"
.. f:read("*all")
c_text = "<span font='"
.. task.font .. " "
.. task.font_size .. "'>"
c_text = "<span font='"
.. task.font .. " "
.. task.font_size .. "'>"