Skip to content

Instantly share code, notes, and snippets.

@blueyed
Created March 29, 2014 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blueyed/9856840 to your computer and use it in GitHub Desktop.
Save blueyed/9856840 to your computer and use it in GitHub Desktop.
-- Standard awesome library
local gears = require("gears")
local _dbus = dbus; dbus = nil
local naughty = require("naughty") -- XXX: if loaded (with dbus available), notifications do not go to dunst/notify-osd anymore
dbus = _dbus
-- Debug function. Set focusstyle.debug to activate it. {{{2
local gears = require("gears")
local bdebug_level = 10 -- display all
bdebug = function(data, tag, level, timeout)
local level = level or 1
local tag = tag or type(data)
local timeout = timeout or 0
-- bnote(gears.debug.dump_return(data, tag), level, timeout)
print("----- " .. os.date("%Y-%m-%d %H:%M:%S"))
gears.debug.dump(data, tag)
end
bnote = function(s, timeout)
local level = level or 1
local timeout = timeout or 30
-- if not bdebug_level or bdebug_level < level then
-- return
-- end
naughty.notify({
text = s,
timeout = timeout,
font = "monospace 10",
})
end
bdump = function(data, tag) return gears.debug.dump_return(data, tag) end
-- }}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment