diff options
Diffstat (limited to '.config/awesome')
-rw-r--r-- | .config/awesome/rc.lua | 270 | ||||
-rw-r--r-- | .config/awesome/theme.lua | 4 |
2 files changed, 137 insertions, 137 deletions
diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index ea3eb70..0c15a0c 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -15,6 +15,9 @@ require("awful.hotkeys_popup.keys") -- Custom libraries local charitable = require("charitable") +local widget_battery = require("awesome-wm-widgets.batteryarc-widget.batteryarc") +local widget_brightness = require("awesome-wm-widgets.brightness-widget.brightness") +local widget_volume = require("awesome-wm-widgets.pactl-widget.volume") -- {{{ Error handling -- Check if awesome encountered an error during startup and fell back to @@ -43,23 +46,6 @@ do end -- }}} --- {{{ Background services -function run_once(cmd) - findme = cmd - firstspace = cmd:find(" ") - - if firstspace then - findme = cmd:sub(0, firstspace - 1) - end - - awful.util.spawn_with_shell("pgrep -u $USER -x " .. findme .. " > /dev/null || (" .. cmd .. ")") -end - -run_once("xcompmgr") -run_once("chwp") -run_once("redshift -l 51.50:4.59 -t 6500:2500") --- }}} - -- {{{ Variable definitions beautiful.init(awful.util.getdir("config") .. "/theme.lua") @@ -140,48 +126,90 @@ awful.screen.connect_for_each_screen(function(s) end end - -- Create an imagebox widget which will contain an icon indicating which layout we're using. - -- We need one layoutbox per screen. - s.mylayoutbox = awful.widget.layoutbox(s) - s.mylayoutbox:buttons(gears.table.join( - awful.button({ }, 1, function () awful.layout.inc( 1) end), - awful.button({ }, 3, function () awful.layout.inc(-1) end), - awful.button({ }, 4, function () awful.layout.inc( 1) end), - awful.button({ }, 5, function () awful.layout.inc(-1) end))) - - -- Create a taglist widget - s.mytaglist = awful.widget.taglist { + s.widgets = {} + s.bars = {} + + -- Create an imagebox widget which will contain an icon indicating which layout we're using. + -- We need one layoutbox per screen. + s.widgets.layout = awful.widget.layoutbox(s) + s.widgets.layout:buttons(gears.table.join( + awful.button({ }, 1, function () awful.layout.inc( 1) end), + awful.button({ }, 3, function () awful.layout.inc(-1) end), + awful.button({ }, 4, function () awful.layout.inc( 1) end), + awful.button({ }, 5, function () awful.layout.inc(-1) end)) + ) + + -- Create widgets + s.widgets.battery = widget_battery({ + show_current_level = false, + warning_msg_position = top_right, + }) + s.widgets.brightness = widget_brightness({ + program = "brightnessctl", + tooltip = true, + }) + s.widgets.clock = wibox.widget { + widget = wibox.widget.textclock, + format = "%F %H:%M", + } + s.widgets.systray = wibox.widget.systray() + s.widgets.tags = awful.widget.taglist { screen = s, filter = awful.widget.taglist.filter.all, buttons = taglist_buttons, source = function(screen, args) return tags end, } - - -- Create a tasklist widget - s.mytasklist = awful.widget.tasklist { + s.widgets.tasklist = awful.widget.tasklist { screen = s, filter = awful.widget.tasklist.filter.currenttags, buttons = tasklist_buttons, } + s.widgets.volume = widget_volume({ + tooltip = true, + widget_type = "arc", + }) - -- Create the wibox - s.mytaskbar = awful.wibar({ + -- Create the taskbar + s.bars.bottom = awful.wibar({ position = "bottom", screen = s, bg = beautiful.bg_normal .. "cc", }) -- Add widgets to the wibox - s.mytaskbar:setup { + s.bars.bottom:setup { layout = wibox.layout.align.horizontal, - spacing = 16, + s.widgets.tags, + s.widgets.tasklist, + s.widgets.layout, + } + + -- Create the statbar + s.bars.top = awful.wibar({ + position = "top", + screen = s, + bg = beautiful.bg_normal .. "cc", + }) + + s.bars.top:setup { + layout = wibox.layout.align.horizontal, + expand = "none", { layout = wibox.layout.fixed.horizontal, - spacing = 16, - s.mylayoutbox, - s.mytaglist, + s.widgets.layout, + }, + { + layout = wibox.layout.fixed.horizontal, + s.widgets.clock, + }, + { + layout = wibox.layout.fixed.horizontal, + spacing = 4, + s.widgets.systray, + s.widgets.brightness, + s.widgets.volume, + s.widgets.battery, }, - s.mytasklist, } end) -- }}} @@ -196,86 +224,46 @@ root.buttons(gears.table.join( -- {{{ Key bindings globalkeys = gears.table.join( - awful.key({ modkey, }, "s", hotkeys_popup.show_help, - {description="show help", group="awesome"}), - awful.key({ modkey, }, "Left", awful.tag.viewprev, - {description = "view previous", group = "tag"}), - awful.key({ modkey, }, "Right", awful.tag.viewnext, - {description = "view next", group = "tag"}), - awful.key({ modkey, }, "Escape", awful.tag.history.restore, - {description = "go back", group = "tag"}), - - awful.key({ modkey, }, "j", - function () - awful.client.focus.byidx( 1) - end, - {description = "focus next by index", group = "client"} - ), - awful.key({ modkey, }, "k", - function () - awful.client.focus.byidx(-1) - end, - {description = "focus previous by index", group = "client"} - ), - awful.key({ modkey, }, "w", function () mymainmenu:show() end, - {description = "show main menu", group = "awesome"}), - - - -- Layout manipulation - awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end, - {description = "swap with next client by index", group = "client"}), - awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end, - {description = "swap with previous client by index", group = "client"}), - awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_bydirection("right") end, - {description = "focus the next screen", group = "screen"}), - awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_bydirection("left") end, - {description = "focus the previous screen", group = "screen"}), - awful.key({ modkey, }, "u", awful.client.urgent.jumpto, - {description = "jump to urgent client", group = "client"}), - awful.key({ modkey, }, "Tab", - function () - awful.client.focus.history.previous() - if client.focus then - client.focus:raise() - end - end, - {description = "go back", group = "client"}), - - -- Standard program - awful.key( - { modkey, "Shift" }, "r", awesome.restart, - {description = "reload awesome", group = "awesome"} - ), - awful.key( - { modkey, "Shift" }, "q", awesome.quit, - {description = "quit awesome", group = "awesome"} - ), - - awful.key( - { modkey, }, "p", function () awful.spawn("ipass") end, - { description = "Select password", group = "awesome" } - ), - awful.key( - { modkey, }, "o", function () awful.spawn("ipass-otp") end, - { description = "Select password", group = "awesome" } - ), - - 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, - {description = "decrease master width factor", group = "layout"}), - awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end, - {description = "increase the number of master clients", group = "layout"}), - awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end, - {description = "decrease the number of master clients", group = "layout"}), - awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end, - {description = "increase the number of columns", group = "layout"}), - awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end, - {description = "decrease the number of columns", group = "layout"}), - awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end, - {description = "select next", group = "layout"}), - awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end, - {description = "select previous", group = "layout"}), + -- Awesome Controls + awful.key({ modkey, }, "s", hotkeys_popup.show_help, {description="show help", group="awesome"}), + awful.key({ modkey, }, "w", function () mymainmenu:show() end, {description = "show main menu", group = "awesome"}), + awful.key({ modkey, "Shift" }, "r", awesome.restart, {description = "reload awesome", group = "awesome"}), + awful.key({ modkey, "Shift" }, "x", awesome.quit, {description = "quit awesome", group = "awesome"}), + + -- Focus + awful.key({ modkey, }, "Down", function () awful.client.focus.byidx(1) end, {description = "focus next by index", group = "client"}), + awful.key({ modkey, }, "Up", function () awful.client.focus.byidx(-1) end, {description = "focus previous by index", group = "client"}), + awful.key({ modkey, }, "Tab", function () awful.client.focus.history.previous() if client.focus then client.focus:raise() end end, {description = "go back", group = "client"}), + awful.key({ modkey, }, "j", function () awful.client.focus.byidx(1) end, {description = "focus next by index", group = "client"}), + awful.key({ modkey, }, "k", function () awful.client.focus.byidx(-1) end, {description = "focus previous by index", group = "client"}), + awful.key({ modkey, }, "u", awful.client.urgent.jumpto, {description = "jump to urgent client", group = "client"}), + awful.key({ modkey, "Control" }, "Left", function () awful.screen.focus_bydirection("left") end), + awful.key({ modkey, "Control" }, "Right", function () awful.screen.focus_bydirection("right") end, {description = "focus the next screen", group = "screen"}), + awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_bydirection("right") end, {description = "focus the next screen", group = "screen"}), + awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_bydirection("left") end, {description = "focus the previous screen", group = "screen"}), + awful.key({ modkey, "Shift" }, "Down", function () awful.client.swap.byidx(1) end, {description = "swap with next client by index", group = "client"}), + awful.key({ modkey, "Shift" }, "Up", function () awful.client.swap.byidx(-1) end, {description = "swap with previous client by index", group = "client"}), + + -- Tags + awful.key({ modkey, }, "Escape", awful.tag.history.restore, {description = "go back", group = "tag"}), + awful.key({ modkey, }, "Left", awful.tag.viewprev, {description = "view previous", group = "tag"}), + awful.key({ modkey, }, "Right", awful.tag.viewnext, {description = "view next", group = "tag"}), + + -- Layouts + awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end, {description = "decrease master width factor", group = "layout"}), + awful.key({ modkey, }, "l", function () awful.tag.incmwfact(0.05) end, {description = "increase master width factor", group = "layout"}), + awful.key({ modkey, }, "space", function () awful.layout.inc(1) end, {description = "select next", group = "layout"}), + awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol(1, nil, true) end, {description = "increase the number of columns", group = "layout"}), + awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end, {description = "decrease the number of columns", group = "layout"}), + awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster(1, nil, true) end, {description = "increase the number of master clients", group = "layout"}), + awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx(1) end, {description = "swap with next client by index", group = "client"}), + awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx(-1) end, {description = "swap with previous client by index", group = "client"}), + awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end, {description = "decrease the number of master clients", group = "layout"}), + awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end, {description = "select previous", group = "layout"}), + + -- Programs + awful.key({ modkey, }, "o", function () awful.spawn("ipass-otp") end, { description = "Select OTP", group = "awesome" }), + awful.key({ modkey, }, "p", function () awful.spawn("ipass") end, { description = "Select password", group = "awesome" }), awful.key({ modkey, "Control" }, "n", function () @@ -417,7 +405,6 @@ awful.rules.rules = { buttons = clientbuttons, screen = awful.screen.preferred, placement = awful.placement.no_overlap+awful.placement.no_offscreen, - opacity = 0.8, }, }, @@ -462,6 +449,7 @@ awful.rules.rules = { { -- Remove borders from windows where it doesn't fit (housestyles ought to be banned, tho) rule_any = { class = { + "albert", "nextcloud", } }, @@ -470,11 +458,23 @@ awful.rules.rules = { }, }, + { -- Tag rules for social + rule_any = { + class = { + "irc", + }, + }, + properties = { + tag = "social", + }, + }, + { -- Tag rules for www rule_any = { class = { "chromium", "firefox", + "firefox-esr", "qutebrowser", }, }, @@ -486,6 +486,7 @@ awful.rules.rules = { { -- Tag rules for email rule_any = { class = { + "evolution", "thunderbird", "kmail", }, @@ -503,6 +504,7 @@ awful.rules.rules = { "tsmapplication.exe", "lutris", "pathofexile.exe", + "mumble" }, }, properties = { @@ -569,10 +571,6 @@ awful.rules.rules = { { rule_any = {type = { "normal", "dialog" } }, properties = { titlebars_enabled = false } }, - - -- Set Firefox to always map on the tag named "2" on screen 1. - -- { rule = { class = "Firefox" }, - -- properties = { screen = 1, tag = "2" } }, } -- }}} @@ -650,21 +648,23 @@ end) client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus - c.opacity = 1 - - -- Mouse follows focus - if mouse.object_under_pointer() ~= c then - local geometry = c:geometry() - mouse.coords({ - x = geometry.x + geometry.width/2, - y = geometry.y + geometry.height/2, - }, true) - end +-- -- Mouse follows focus +-- if mouse.object_under_pointer() ~= c then +-- local geometry = c:geometry() +-- +-- mouse.coords({ +-- x = geometry.x + geometry.width/2, +-- y = geometry.y + geometry.height/2, +-- }, true) +-- end end) client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal - c.opacity = 0.8 end) -- }}} + +awful.util.spawn("systemctl --user import-environment DISPLAY") +awful.util.spawn("systemctl --user import-environment XAUTHORITY") +awful.util.spawn("systemctl --user start awesome-session.target") diff --git a/.config/awesome/theme.lua b/.config/awesome/theme.lua index 61bec2c..25c9167 100644 --- a/.config/awesome/theme.lua +++ b/.config/awesome/theme.lua @@ -28,11 +28,11 @@ theme.border_normal = "#4b5165" theme.border_focus = "#5294e2" theme.border_marked = "#91231c" -theme.taglist_spacing = dpi(4) +theme.taglist_spacing = 0 theme.taglist_bg_occupied = "#4b5165" theme.tasklist_bg_normal = "#4b5165" -theme.tasklist_spacing = dpi(4) +theme.tasklist_spacing = 0 theme.useless_gap = dpi(4) theme.maximized_honor_padding = true |