-- awesome_mode: api-level=4:screen=on -- If LuaRocks is installed, make sure that packages installed through it are -- found (e.g. lgi). If LuaRocks is not installed, do nothing. pcall(require, "luarocks.loader") --- Error handling. -- Notification library. local naughty = require("naughty") local function log_memory(label) local mem = collectgarbage("count") -- KB naughty.notification({ title = "AWM Memory", text = string.format("%s: %.1f MB", label, mem / 1024), timeout = 3, }) print(string.format("[MEM] %s: %.1f MB", label, mem / 1024)) end -- Check if awesome encountered an error during startup and fell back to -- another config (This code will only ever execute for the fallback config). naughty.connect_signal("request::display_error", function(message, startup) naughty.notification({ urgency = "critical", title = "Oops, an error happened" .. (startup and " during startup!" or "!"), message = message, }) end) -- Allow Awesome to automatically focus a client upon changing tags or loading. require("awful.autofocus") -- Enable hotkeys help widget for VIM and other apps when client with a matching -- name is opened: require("awful.hotkeys_popup.keys") require("module.better-resize") -- Load the theme. In other words, defines the variables within the `beautiful` -- table. require("theme") -- Treat all signals. Bear in mind this implies creating all tags, attaching -- their layouts, setting client behavior and loading UI. require("ui.lock") require("signal") -- Set all keybinds. require("binds") -- Load all client rules. require("config.rules") require("awful").screen .focused().tags[tonumber(require("module.helpers").tag.read_last()) and tonumber(require("module.helpers").tag.read_last()) or 1] :view_only() local awful = require("awful") local wibox = require("wibox") local gears = require("gears") local w local button = awful.widget.button() button:buttons(gears.table.join( button:buttons(), awful.button({}, 1, nil, function() awful.mouse.wibox.move(w) end) )) local tbl = { x = mouse.coords().x, y = mouse.coords().y, } local help = require("module.helpers") local ww = help.menu.create({ radius = 100 }) local test_widget = wibox.widget({ widget = wibox.widget.textbox, text = "Hello!", }) ww:add_widget(test_widget) ww:add_widget(test_widget) ww:add_widget(test_widget) ww:add_widget(test_widget) w = awful.popup({ widget = { { widget = wibox.container.background, bg = "#ffffff", forced_height = 100, forced_width = 45, buttons = { awful.button({}, 1, function() awful.mouse.wibox.move(w) end), awful.button({}, 3, function() local c = mouse.coords() ww:toggle(c.x, c.y) end), }, }, layout = wibox.layout.fixed.vertical, }, shape = gears.shape.rounded_rect, visible = true, x = 250, y = 100, }) require("gears").timer({ timeout = 5, autostart = true, call_now = true, callback = function() collectgarbage("collect") end, })