moving to awesome literate

This commit is contained in:
Chris Cochrun 2020-09-03 05:01:41 -05:00
parent 4fae307cdf
commit 24e347ed36
11 changed files with 1177 additions and 243 deletions

View file

@ -1,5 +1,3 @@
-- 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")
-- Standard awesome library
@ -13,49 +11,29 @@ local wibox = require("wibox")
-- Theme handling library
local beautiful = require("beautiful")
-- Notification library
local naughty = require("naughty")
-- local naughty = require("naughty")
local menubar = require("menubar")
local hotkeys_popup = require("awful.hotkeys_popup")
local ruled = require("ruled")
local nice = require("nice")
-- Enable hotkeys help widget for VIM and other apps
-- when client with a matching name is opened:
require("awful.hotkeys_popup.keys")
-- require('layout')
-- Widgets to add
-- local batteryarc_widget = require("awesome-wm-widget.batteryarc-widget.batteryarc")
-- >> Daemons
-- Most widgets that display system/external info depend on evil.
-- Make sure to initialize it last in order to allow all widgets to connect to
-- their needed evil signals.
-- require("evil")
-- ===================================================================
-- ===================================================================
-- ========================================
-- Modules
-- Load all the modules
-- ========================================
require('module.notifications')
-- require('module.auto-start')
require('module.decorate-client')
require('module.backdrop')
require('module.volume-osd')
require('module.brightness-osd')
-- require('module.auto-start')
-- require('module.exit-screen')
-- require('module.quake-terminal')
-- require('module.titlebar')
-- require('module.menu')
require('module.volume-osd')
require('module.brightness-osd')
-- require('module.dynamic-wallpaper')
-- require('module.battery-notifier')
-- require('module.lockscreen')
-- -- {{{ 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)
@ -87,7 +65,7 @@ beautiful.init("/home/chris/.config/awesome/theme.lua")
-- This is used later as the default terminal and editor to run.
terminal = "alacritty"
editor = os.getenv("EDITOR") or "emacsclient -a emacs"
editor = "emacsclient -a emacs"
editor_cmd = terminal .. " -e " .. editor
-- Default modkey.
@ -420,9 +398,6 @@ awful.screen.connect_for_each_screen(function(s)
end)
-- }}}
testwibox = wibox {x = 20, y = 10, width = 10, height = 10, ontop = true, bg = "#000000"}
testwibox:to_widget()
-- {{{ Mouse bindings
root.buttons(gears.table.join(
awful.button({ }, 3, function () mymainmenu:toggle() end),
@ -504,7 +479,11 @@ globalkeys = gears.table.join(
{description = "open firefox", group = "apps"}),
awful.key({ modkey, }, "e", function () awful.spawn("emacsclient -c") end,
{description = "open emacs frame connected to server", group = "apps"}),
-- dolphin
awful.key({ modkey, }, "d", function () awful.spawn("dolphin") end,
{description = "open dolphin file manager", group = "apps"}),
-- layout
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
{description = "increase master width factor", group = "layout"}),
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end,
@ -601,7 +580,7 @@ clientkeys = gears.table.join(
c:raise()
end,
{description = "toggle fullscreen", group = "client"}),
awful.key({ modkey, }, "q", function (c) c:kill() end,
awful.key({ modkey, }, "c", function (c) c:kill() end,
{description = "close", group = "client"}),
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ,
{description = "toggle floating", group = "client"}),
@ -708,68 +687,83 @@ root.keys(globalkeys)
-- {{{ Rules
-- Rules to apply to new clients (through the "manage" signal).
ruled.client.append_rule {
-- All clients will match this rule.
rule = {},
properties = { border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = awful.client.focus.filter,
raise = true,
keys = clientkeys,
buttons = clientbuttons,
screen = awful.screen.preferred,
placement = awful.placement.no_overlap+awful.placement.no_offscreen
},
}
client.connect_signal("request::rules", function(c)
ruled.client.append_rule {
-- All clients will match this rule.
rule = {},
properties = {
border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = awful.client.focus.filter,
raise = true,
keys = clientkeys,
buttons = clientbuttons,
screen = awful.screen.preferred,
placement = awful.placement.no_overlap+awful.placement.no_offscreen
},
}
ruled.client.append_rule {
-- Floating clients.
rule_any = {
class = {
"Arandr",
"Blender",
"dolphin",
},
name = {
"Event Tester", -- xev.
"remove images?" -- darktable delete window.
},
role = {
"AlarmWindow", -- Thunderbird's calendar.
"ConfigManager", -- Thunderbird's about:config.
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
}
},
properties = { floating = true },
}
ruled.client.append_rule {
-- make mpv float
rule_any = {
class = {
"mpv",
"gl",
"vlc"
}
},
properties = {
placement = awful.placement.centered,
floating = true,
ontop = true
},
ruled.client.append_rule {
-- Add titlebars to normal clients and dialogs
rule_any = { type = { "normal", "dialog" } },
properties = { titlebars_enabled = false},
}
}
ruled.client.append_rule {
-- Set Firefox to never have titlebars
rule = { class = "Firefox" },
properties = { requests_no_titlebar = true, titlebars_enabled = false },
}
-- ruled.client.append_rule {
-- -- Floating clients.
-- rule_any = {
-- class = {
-- "Arandr",
-- "Blender",
-- "dolphin",
-- },
-- name = {
-- "Event Tester", -- xev.
-- "remove images?" -- darktable delete window.
-- },
-- role = {
-- "AlarmWindow", -- Thunderbird's calendar.
-- "ConfigManager", -- Thunderbird's about:config.
-- "pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
-- }
-- },
-- properties = { floating = true },
-- }
ruled.client.append_rule {
-- Set Feh center
rule = { class = "feh" },
properties = {
placement = awful.placement.centered,
floating = true
},
}
-- ruled.client.append_rule {
-- -- Add titlebars to normal clients and dialogs
-- rule_any = { type = { "normal", "dialog" } },
-- properties = { titlebars_enabled = false},
-- }
ruled.client.append_rule {
rule_any = { class = { "FelgoLiveClient", "mpv", "gl" } },
properties = {floating = true, ontop = true},
}
-- ruled.client.append_rule {
-- -- Set Firefox to never have titlebars
-- rule = { class = "Firefox" },
-- properties = { requests_no_titlebar = true, titlebars_enabled = false },
-- }
-- ruled.client.append_rule {
-- -- Set Feh center
-- rule = { class = "feh" },
-- properties = {
-- placement = awful.placement.centered,
-- floating = true
-- },
-- }
end)
-- }}}
awful.spawn.with_shell("mpv /home/chris/Videos/transcoded/a love letter.mp4")
-- {{{ Signals
-- Signal function to execute when a new client appears.
@ -786,62 +780,25 @@ client.connect_signal("manage", function (c)
end
end)
-- Add a titlebar if titlebars_enabled is set to true in the rules.
client.connect_signal("request::titlebars", function(c)
-- buttons for the titlebar
local buttons = gears.table.join(
awful.button({ }, 1, function()
c:emit_signal("request::activate", "titlebar", {raise = true})
awful.mouse.client.move(c)
end),
awful.button({ }, 3, function()
c:emit_signal("request::activate", "titlebar", {raise = true})
awful.mouse.client.resize(c)
end)
)
awful.titlebar(c) : setup {
{ -- Left
awful.titlebar.widget.iconwidget(c),
buttons = buttons,
layout = wibox.layout.fixed.horizontal
},
{ -- Middle
{ -- Title
align = "center",
widget = awful.titlebar.widget.titlewidget(c)
},
buttons = buttons,
layout = wibox.layout.flex.horizontal
},
{ -- Right
awful.titlebar.widget.floatingbutton (c),
awful.titlebar.widget.maximizedbutton(c),
awful.titlebar.widget.stickybutton (c),
awful.titlebar.widget.ontopbutton (c),
awful.titlebar.widget.closebutton (c),
layout = wibox.layout.fixed.horizontal()
},
layout = wibox.layout.align.horizontal
}
end)
-- Enable sloppy focus, so that focus follows mouse.
-- client.connect_signal("mouse::enter", function(c)
-- c:emit_signal("request::activate", "mouse_enter", {raise = false})
-- end)
-- Enable nice titlebars
nice()
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
-- }}}
-- Autostart Applications
awful.spawn.with_shell("picom --experimental-backend")
awful.spawn.with_shell("libinput-gestures-setup start")
awful.spawn.with_shell("flameshot")
awful.spawn.with_shell("xset r rate 220 90")
awful.spawn.with_shell("feh --bg-fill ~/Pictures/wallpapers/RoyalKing.png")
-- awful.spawn.with_shell("feh --bg-fill ~/Pictures/wallpapers/RoyalKing.png")
awful.spawn.with_shell("/usr/lib/polkit-kde-authentication-agent-1")
awful.spawn.with_shell("emacs -daemon")
awful.spawn.with_shell("nextcloud --background")