pcall(require, "luarocks.loader") local gears = require('gears') local awful = require('awful') local beautiful = require('beautiful') beautiful.init(require('theme')) require('awful.autofocus') require('preferences.apps') require('preferences.layouts') require('modules.client') require('modules.titlebar') require('modules.panel') -- require('modules.sidepanel') require('bindings.keys') -- BELOW NEEDS CLEANUP -- -- Widget and layout library local wibox = require("wibox") -- Notification library local naughty = require("naughty") -- Declarative object management local ruled = require("ruled") local menubar = require("menubar") -- Enable hotkeys help widget for VIM and other apps -- when client with a matching name is opened: -- {{{ Error handling -- 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) -- }}} -- This is used later as the default terminal and editor to run. terminal = "kitty" editor = os.getenv("EDITOR") or "vi" editor_cmd = terminal .. " -e " .. editor -- Default modkey. -- Usually, Mod4 is the key with a logo between Control and Alt. -- If you do not like this or do not have such a key, -- I suggest you to remap Mod4 to another key using xmodmap or other tools. -- However, you can use another modifier like Mod1, but it may interact with others. modkey = "Mod4" -- }}} -- {{{ Menu -- Create a launcher widget and a main menu myawesomemenu = { { "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end }, { "manual", terminal .. " -e man awesome" }, { "edit config", editor_cmd .. " " .. awesome.conffile }, { "restart", awesome.restart }, { "quit", function() awesome.quit() end }, } mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, { "open terminal", terminal } } }) mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon, menu = mymainmenu }) -- Menubar configuration menubar.utils.terminal = terminal -- Set the terminal for applications that require it -- }}} -- {{{ Tag -- Table of layouts to cover with awful.layout.inc, order matters. -- }}} -- {{{ Wibar screen.connect_signal("request::wallpaper", function(s) -- Wallpaper if beautiful.wallpaper then local wallpaper = beautiful.wallpaper -- If wallpaper is a function, call it with the screen if type(wallpaper) == "function" then wallpaper = wallpaper(s) end gears.wallpaper.maximized(wallpaper, s, true) end end) -- {{{ Mouse bindings awful.mouse.append_global_mousebindings({ awful.button({ }, 3, function () mymainmenu:toggle() end), awful.button({ }, 4, awful.tag.viewnext), awful.button({ }, 5, awful.tag.viewprev), }) -- }}} -- {{{ Rules -- Rules to apply to new clients. ruled.client.connect_signal("request::rules", function() -- All clients will match this rule. ruled.client.append_rule { id = "global", rule = { }, properties = { focus = awful.client.focus.filter, raise = true, screen = awful.screen.preferred, placement = awful.placement.no_overlap+awful.placement.no_offscreen } } -- Floating clients. ruled.client.append_rule { id = "floating", rule_any = { instance = { "copyq", "pinentry" }, class = { "Arandr", "Blueman-manager", "Gpick", "Kruler", "Sxiv", "Tor Browser", "Wpa_gui", "veromix", "xtightvncviewer" }, -- Note that the name property shown in xprop might be set slightly after creation of the client -- and the name shown there might not match defined rules here. name = { "Event Tester", -- xev. }, role = { "AlarmWindow", -- Thunderbird's calendar. "ConfigManager", -- Thunderbird's about:config. "pop-up", -- e.g. Google Chrome's (detached) Developer Tools. } }, properties = { floating = true } } -- Add titlebars to normal clients and dialogs ruled.client.append_rule { id = "titlebars", rule_any = { type = { "normal", "dialog" } }, properties = { titlebars_enabled = true } } ruled.client.append_rule { rule = { class = "Plank" }, properties = { border_width = 0, floating = true, sticky = true, ontop = true, focusable = false, below = true } } -- Set Firefox to always map on the tag named "2" on screen 1. -- ruled.client.append_rule { -- rule = { class = "Firefox" }, -- properties = { screen = 1, tag = "2" } -- } end) -- }}} -- {{{ Notifications ruled.notification.connect_signal('request::rules', function() -- All notifications will match this rule. ruled.notification.append_rule { rule = { }, properties = { screen = awful.screen.preferred, implicit_timeout = 5, } } end) naughty.connect_signal("request::display", function(n) naughty.layout.box { notification = n } end) -- }}} -- Enable sloppy focus, so that focus follows mouse. client.connect_signal("mouse::enter", function(c) c:activate { context = "mouse_enter", raise = false } end)