awesomewm/rc.lua

120 lines
2.9 KiB
Lua
Raw Permalink Normal View History

2022-08-27 23:00:55 +00:00
-- 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")
2013-04-13 15:17:09 +00:00
-- libraries {{{
local awful = require("awful")
2024-01-27 16:17:06 +00:00
local beautiful = require("beautiful")
2024-07-29 23:10:42 +00:00
local gears = require("gears")
2024-01-27 16:17:06 +00:00
---@diagnostic disable-next-line: unused-local
--- for debugging
local inspect = require("inspect")
2024-07-29 23:10:42 +00:00
local wibox = require("wibox")
2024-01-27 16:17:06 +00:00
require("awful.autofocus")
require("util.errors")
2013-04-13 15:17:09 +00:00
-- }}}
2010-06-06 02:56:07 +00:00
beautiful.init(awful.util.getdir("config") .. "/theme.lua")
require("tapestry")
2013-04-15 12:27:38 +00:00
-- {{{ Logging
2024-01-27 16:17:06 +00:00
local log = require("talkative")
2015-05-24 21:47:19 +00:00
log.add_logger(log.loggers.stdio, log.level.DEBUG)
log.add_logger(log.loggers.naughty, log.level.WARNING)
2013-04-15 12:27:38 +00:00
-- }}}
2013-04-13 15:17:09 +00:00
-- {{{ Tags
2024-07-29 23:10:42 +00:00
local tags = require("tags")
2013-04-13 15:17:09 +00:00
tags.setup()
2013-05-01 22:25:52 +00:00
2013-04-13 15:17:09 +00:00
-- }}}
-- {{{ widgets
2024-01-27 16:17:06 +00:00
local widgets = require("widgets")
awful.screen.connect_for_each_screen(function(s)
2024-01-27 16:17:06 +00:00
widgets.dynamic_taskbar(s)
2024-07-29 23:10:42 +00:00
widgets(s).left({
widgets.screennum(s),
widgets.spacer,
widgets.layout(s),
widgets.taglist(s),
layout = wibox.layout.fixed.horizontal,
}, wibox.widget.textclock())
widgets(s).right({
widgets.cpu(),
widgets.ram(),
widgets.battery(s),
widgets.systray(s),
layout = wibox.layout.fixed.horizontal,
}, widgets.mail({ os.getenv("HOME") .. "/.maildir/uber" }, "bottom_right", "uber"))
end)
2013-04-13 15:17:09 +00:00
-- }}}
2024-01-27 16:17:06 +00:00
local audiowheel = require("audiowheel")
2024-07-29 23:10:42 +00:00
local speakerwheel = audiowheel({
2024-01-27 16:17:06 +00:00
volume_control = { cardid = 0 },
2024-07-29 23:10:42 +00:00
})
2017-10-31 21:15:59 +00:00
2024-07-29 23:10:42 +00:00
local micwheel = audiowheel({
image_muted = "notification-microphone-sensitivity-muted.svg",
image_low = "notification-microphone-sensitivity-low.svg",
image_medium = "notification-microphone-sensitivity-medium.svg",
image_high = "notification-microphone-sensitivity-high.svg",
--volume_control = { cardid = 0, tooltip = false, channel = "Dmic0" }
volume_control = { tooltip = false, type = "source" },
})
2017-10-31 21:15:59 +00:00
2013-04-13 15:17:09 +00:00
-- {{{ Key bindings
2024-01-27 16:17:06 +00:00
local binder = require("separable.binder")
2018-11-08 19:27:02 +00:00
binder.modal.set_location("bottom_left")
2019-08-10 18:37:10 +00:00
binder.modal.hide_default_options()
2020-10-20 15:54:25 +00:00
binder.modal.set_opacity(0.8)
2018-11-08 19:27:02 +00:00
--binder.modal.set_x_offset(18)
binder.add_default_bindings()
binder.add_reloadable(tags.create_bindings)
2024-01-27 16:17:06 +00:00
local mybindings = awful.util.getdir("config") .. "/mybindings.lua"
2024-07-29 23:10:42 +00:00
binder.add_reloadable(function()
return dofile(mybindings)
end)
2017-10-31 21:15:59 +00:00
binder.add_bindings(awful.util.table.join(
2024-07-29 23:10:42 +00:00
awful.key({}, "XF86AudioRaiseVolume", function()
speakerwheel:up()
end),
awful.key({}, "XF86AudioLowerVolume", function()
speakerwheel:down()
end),
awful.key({}, "XF86AudioMute", function()
speakerwheel:toggle()
end),
awful.key({ "Shift" }, "XF86AudioRaiseVolume", function()
micwheel:up()
end),
awful.key({ "Shift" }, "XF86AudioLowerVolume", function()
micwheel:down()
end),
awful.key({}, "XF86AudioMicMute", function()
micwheel:toggle()
end)
2017-10-31 21:15:59 +00:00
))
binder.apply()
2013-04-13 15:17:09 +00:00
-- }}}
require("rules")
2013-04-13 15:17:09 +00:00
require("signals")
2024-01-27 16:17:06 +00:00
local autorun_file = awful.util.getdir("config") .. "/autorun"
if gears.filesystem.file_readable(autorun_file) then
awful.spawn(autorun_file)
end
2013-04-13 15:17:09 +00:00
--
-- vim: fdm=marker
2014-05-16 16:17:10 +00:00
--