From 1a646f724ebd8c79bfecd89b57207842e25b93c7 Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Sun, 24 Sep 2023 07:06:32 -0400 Subject: awesome: better titlebar decoration, keybind to open webbrowser --- programs/dotfiles/awesome/rc.lua | 60 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 6 deletions(-) (limited to 'programs/dotfiles/awesome/rc.lua') diff --git a/programs/dotfiles/awesome/rc.lua b/programs/dotfiles/awesome/rc.lua index e2b8cb7..f8cc3d6 100644 --- a/programs/dotfiles/awesome/rc.lua +++ b/programs/dotfiles/awesome/rc.lua @@ -68,6 +68,7 @@ end -- This is used later as the default terminal and editor to run. terminal = "kitty" +webbrowser = "firefox" editor = os.getenv("EDITOR") or "nvim" editor_cmd = terminal .. " -e " .. editor @@ -123,7 +124,14 @@ menubar.utils.terminal = terminal -- Set the terminal for applications that requ -- {{{ Wibar -- Create a textclock widget -mytextclock = wibox.widget.textclock() +toptextclock = wibox.widget { + { + widget = wibox.widget.textclock + }, + bg = beautiful.bg_normal, + widget = wibox.container.background, + shape = gears.shape.rounded_rect +} -- Create a wibox for each screen and add it local taglist_buttons = gears.table.join( @@ -317,8 +325,8 @@ awful.screen.connect_for_each_screen(function(s) s.mytasklist, -- Middle widget { -- Right widgets layout = wibox.layout.fixed.horizontal, - wibox.container.margin(s.systray, 0, 0, 3, 3), - mytextclock, + wibox.container.margin(s.systray, 0, 0, 4, 4), + toptextclock, s.mylayoutbox, }, } @@ -356,8 +364,6 @@ globalkeys = gears.table.join( 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, @@ -382,6 +388,9 @@ globalkeys = gears.table.join( -- Standard program awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end, {description = "open a terminal", group = "launcher"}), + awful.key({ modkey, }, "w", function () awful.spawn(webbrowser) end, + {description = "open the web browser", group = "launcher"}), + awful.key({ modkey, "Control" }, "r", awesome.restart, {description = "reload awesome", group = "awesome"}), awful.key({ modkey, "Shift" }, "q", awesome.quit, @@ -650,7 +659,46 @@ client.connect_signal("request::titlebars", function(c) }, { -- Right awful.titlebar.widget.maximizedbutton(c), - awful.titlebar.widget.closebutton (c), + { + { + { + { + widget = awful.titlebar.widget.maximizedbutton(c), + }, + widget = wibox.container.background, + shape = gears.shape.circle, + shape_border_width = 1, + shape_border_color = "#12ac28", + bg = "#28c940", + }, + width = 16, + strategy = "min", + layout = wibox.layout.constraint + }, + right = 8, + widget = wibox.container.margin, + align = "center", + }, + { + { + { + { + widget = awful.titlebar.widget.closebutton(c), + }, + widget = wibox.container.background, + shape = gears.shape.circle, + shape_border_width = 1, + shape_border_color = "#ad3934", + bg = "#bf4943", + }, + width = 16, + strategy = "min", + layout = wibox.layout.constraint + }, + right = 8, + widget = wibox.container.margin, + align = "center", + }, layout = wibox.layout.fixed.horizontal() }, shape = gears.shape.rounded_rect, -- cgit v1.2.1