From 225eeafcea67d63a608f9c666faf2a2ef014be4a Mon Sep 17 00:00:00 2001 From: delta Date: Mon, 19 Jan 2026 06:30:33 +0100 Subject: sync: electric boogaloo --- .config/awesome/quarrel/debug.lua | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .config/awesome/quarrel/debug.lua (limited to '.config/awesome/quarrel/debug.lua') diff --git a/.config/awesome/quarrel/debug.lua b/.config/awesome/quarrel/debug.lua new file mode 100644 index 0000000..54fc317 --- /dev/null +++ b/.config/awesome/quarrel/debug.lua @@ -0,0 +1,39 @@ +local n = require("naughty").notification +local gdebug = require "gears.debug" + +---@class QuarrelDebug +local M = {} + +--- Send a notification with the specified message +---@param message any +function M.debug(message) + if type(message) == "table" then + gdebug.dump(message, "data", 8) + n { message = "Dumped table!", app_name = "QDebug", level = "debug" } + else + n { message = tostring(message), app_name = "QDebug", level = "debug" } + end +end + +--- Print an info message to stdout and send a notification at the same time +---@param message any +function M.info(message) + print("[QDebug]: " .. tostring(message)) + n { message = message, app_name = "QDebug", level = "info" } +end + +--- Print a warning to stderr and send a notification at the same time +---@param message any +function M.warn(message) + gdebug.print_warning("[QDebug]: " .. tostring(message)) + n { message = message, app_name = "QDebug", level = "warn" } +end + +--- Print an error to stderr and send a notification at the same time +---@param message any +function M.error(message) + gdebug.print_warning("[QDebug]: " .. tostring(message)) + n { message = message, app_name = "QDebug", level = "error" } +end + +return M -- cgit v1.2.3