mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-08-09 17:41:12 +10:00
Adding literate config for AwesomeWM
This commit is contained in:
Executable → Regular
+1
-61
@@ -1,20 +1,6 @@
|
||||
--[[
|
||||
____ _____
|
||||
| _ \_ _| Derek Taylor (DistroTube)
|
||||
| | | || | http://www.youtube.com/c/DistroTube
|
||||
| |_| || | http://www.gitlab.com/dwt1/
|
||||
|____/ |_|
|
||||
|
||||
My awesome window manager configuration. Provided here for those that want to examine or use
|
||||
my config in part or in whole. Take what works for you; leave the rest!
|
||||
|
||||
--]]
|
||||
|
||||
-- {{{ libraries
|
||||
local awesome, client, mouse, screen, tag = awesome, client, mouse, screen, tag
|
||||
local ipairs, string, os, table, tostring, tonumber, type = ipairs, string, os, table, tostring, tonumber, type
|
||||
|
||||
--https://awesomewm.org/doc/api/documentation/05-awesomerc.md.html
|
||||
-- Standard awesome library
|
||||
local gears = require("gears") --Utilities such as color parsing and objects
|
||||
local awful = require("awful") --Everything related to window managment
|
||||
@@ -29,8 +15,6 @@ local beautiful = require("beautiful")
|
||||
local naughty = require("naughty")
|
||||
naughty.config.defaults['icon_size'] = 100
|
||||
|
||||
--local menubar = require("menubar")
|
||||
|
||||
local lain = require("lain")
|
||||
local freedesktop = require("freedesktop")
|
||||
|
||||
@@ -39,13 +23,7 @@ local freedesktop = require("freedesktop")
|
||||
local hotkeys_popup = require("awful.hotkeys_popup").widget
|
||||
require("awful.hotkeys_popup.keys")
|
||||
local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility
|
||||
-- }}}
|
||||
|
||||
|
||||
|
||||
-- {{{ 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)
|
||||
if awesome.startup_errors then
|
||||
naughty.notify({ preset = naughty.config.presets.critical,
|
||||
title = "Oops, there were errors during startup!",
|
||||
@@ -66,11 +44,7 @@ do
|
||||
in_error = false
|
||||
end)
|
||||
end
|
||||
-- }}}
|
||||
|
||||
|
||||
|
||||
-- {{{ Autostart windowless processes
|
||||
local function run_once(cmd_arr)
|
||||
for _, cmd in ipairs(cmd_arr) do
|
||||
awful.spawn.with_shell(string.format("pgrep -u $USER -fx '%s' > /dev/null || (%s)", cmd, cmd))
|
||||
@@ -78,16 +52,11 @@ local function run_once(cmd_arr)
|
||||
end
|
||||
|
||||
run_once({ "unclutter -root" }) -- entries must be comma-separated
|
||||
-- }}}
|
||||
|
||||
|
||||
-- {{{ Variable definitions
|
||||
|
||||
local themes = {
|
||||
"powerarrow-blue", -- 1
|
||||
"powerarrow", -- 2
|
||||
"multicolor", -- 3
|
||||
|
||||
}
|
||||
|
||||
-- choose your theme here
|
||||
@@ -96,13 +65,11 @@ local chosen_theme = themes[1]
|
||||
local theme_path = string.format("%s/.config/awesome/themes/%s/theme.lua", os.getenv("HOME"), chosen_theme)
|
||||
beautiful.init(theme_path)
|
||||
|
||||
-- modkey or mod4 = super key
|
||||
local modkey = "Mod4"
|
||||
local altkey = "Mod1"
|
||||
local modkey1 = "Control"
|
||||
|
||||
-- personal variables
|
||||
--change these variables if you want
|
||||
local browser = "firefox"
|
||||
local editor = os.getenv("EDITOR") or "vim"
|
||||
local editorgui = "geany"
|
||||
@@ -195,11 +162,7 @@ lain.layout.cascade.tile.nmaster = 5
|
||||
lain.layout.cascade.tile.ncol = 2
|
||||
|
||||
beautiful.init(string.format(gears.filesystem.get_configuration_dir() .. "/themes/%s/theme.lua", chosen_theme))
|
||||
-- }}}
|
||||
|
||||
|
||||
|
||||
-- {{{ Menu
|
||||
local myawesomemenu = {
|
||||
{ "hotkeys", function() return false, hotkeys_popup.show_help end },
|
||||
{ "manual", terminal .. " -e 'man awesome'" },
|
||||
@@ -225,11 +188,7 @@ awful.util.mymainmenu = freedesktop.menu.build({
|
||||
}
|
||||
})
|
||||
--menubar.utils.terminal = terminal -- Set the Menubar terminal for applications that require it
|
||||
-- }}}
|
||||
|
||||
|
||||
|
||||
-- {{{ Screen
|
||||
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
|
||||
screen.connect_signal("property::geometry", function(s)
|
||||
-- Wallpaper
|
||||
@@ -244,21 +203,13 @@ screen.connect_signal("property::geometry", function(s)
|
||||
end)
|
||||
-- Create a wibox for each screen and add it
|
||||
awful.screen.connect_for_each_screen(function(s) beautiful.at_screen_connect(s) end)
|
||||
-- }}}
|
||||
|
||||
|
||||
|
||||
-- {{{ Mouse bindings
|
||||
root.buttons(my_table.join(
|
||||
awful.button({ }, 3, function () awful.util.mymainmenu:toggle() end),
|
||||
awful.button({ }, 4, awful.tag.viewnext),
|
||||
awful.button({ }, 5, awful.tag.viewprev)
|
||||
))
|
||||
-- }}}
|
||||
|
||||
|
||||
|
||||
-- {{{ Key bindings
|
||||
globalkeys = my_table.join(
|
||||
|
||||
-- {{{ Personal keybindings
|
||||
@@ -281,7 +232,7 @@ globalkeys = my_table.join(
|
||||
{description = "surfraw web search" , group = "dmenu scripts" }),
|
||||
awful.key({ altkey, "Control" }, "t", function () awful.util.spawn( "./.dmenu/dmenu-trading.sh" ) end,
|
||||
{description = "trading programs" , group = "dmenu scripts" }),
|
||||
|
||||
|
||||
-- My applications (Super+Alt+Key)
|
||||
awful.key({ modkey, altkey }, "a", function () awful.util.spawn( terminal.." -e ncpamixer" ) end,
|
||||
{description = "ncpamixer" , group = "terminal apps" }),
|
||||
@@ -695,11 +646,7 @@ clientbuttons = gears.table.join(
|
||||
|
||||
-- Set keys
|
||||
root.keys(globalkeys)
|
||||
-- }}}
|
||||
|
||||
|
||||
|
||||
-- {{{ Rules
|
||||
-- Rules to apply to new clients (through the "manage" signal).
|
||||
awful.rules.rules = {
|
||||
-- All clients will match this rule.
|
||||
@@ -807,9 +754,7 @@ awful.rules.rules = {
|
||||
}, properties = { floating = true }},
|
||||
|
||||
}
|
||||
-- }}}
|
||||
|
||||
-- {{{ Signals
|
||||
-- Signal function to execute when a new client appears.
|
||||
client.connect_signal("manage", function (c)
|
||||
-- Set the windows at the slave,
|
||||
@@ -871,7 +816,6 @@ client.connect_signal("request::titlebars", function(c)
|
||||
}
|
||||
end)
|
||||
|
||||
-- Enable sloppy focus, so that focus follows mouse.
|
||||
client.connect_signal("mouse::enter", function(c)
|
||||
c:emit_signal("request::activate", "mouse_enter", {raise = true})
|
||||
end)
|
||||
@@ -890,10 +834,6 @@ client.connect_signal("focus", border_adjust)
|
||||
client.connect_signal("property::maximized", border_adjust)
|
||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||
|
||||
|
||||
-- }}}
|
||||
|
||||
-- Autostart applications
|
||||
awful.spawn.with_shell("nitrogen --restore")
|
||||
awful.spawn.with_shell("picom --config $HOME/.config/picom/picom.conf")
|
||||
awful.spawn.with_shell("nm-applet")
|
||||
|
||||
Reference in New Issue
Block a user