From 9a2c8d4ca8728f7f47f2accf6918d28e83779a77 Mon Sep 17 00:00:00 2001 From: cool-cool-sweat <35659567+cool-cool-sweat@users.noreply.github.com> Date: Mon, 22 Jan 2018 05:51:55 -0500 Subject: [PATCH 1/2] Replace deprecated awful.util.table.join w/ gears.table.join --- rc.lua.template | 16 ++++++++-------- themes/blackburn/theme.lua | 2 +- themes/copland/theme.lua | 4 ++-- themes/dremora/theme.lua | 2 +- themes/holo/theme.lua | 12 ++++++------ themes/multicolor/theme.lua | 2 +- themes/powerarrow-dark/theme.lua | 6 +++--- themes/powerarrow/theme.lua | 10 +++++----- themes/rainbow/theme.lua | 4 ++-- themes/steamburn/theme.lua | 2 +- themes/vertex/theme.lua | 4 ++-- 11 files changed, 32 insertions(+), 32 deletions(-) diff --git a/rc.lua.template b/rc.lua.template index 2604682..9c4b14b 100644 --- a/rc.lua.template +++ b/rc.lua.template @@ -108,7 +108,7 @@ awful.layout.layouts = { --lain.layout.termfair, --lain.layout.termfair.center, } -awful.util.taglist_buttons = awful.util.table.join( +awful.util.taglist_buttons = gears.table.join( awful.button({ }, 1, function(t) t:view_only() end), awful.button({ modkey }, 1, function(t) if client.focus then @@ -124,7 +124,7 @@ awful.util.taglist_buttons = awful.util.table.join( awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end), awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end) ) -awful.util.tasklist_buttons = awful.util.table.join( +awful.util.tasklist_buttons = gears.table.join( awful.button({ }, 1, function (c) if c == client.focus then c.minimized = true @@ -214,7 +214,7 @@ awful.screen.connect_for_each_screen(function(s) beautiful.at_screen_connect(s) -- }}} -- {{{ Mouse bindings -root.buttons(awful.util.table.join( +root.buttons(gears.table.join( awful.button({ }, 3, function () awful.util.mymainmenu:toggle() end), awful.button({ }, 4, awful.tag.viewnext), awful.button({ }, 5, awful.tag.viewprev) @@ -222,7 +222,7 @@ root.buttons(awful.util.table.join( -- }}} -- {{{ Key bindings -globalkeys = awful.util.table.join( +globalkeys = gears.table.join( -- Take a screenshot -- https://github.com/lcpz/dots/blob/master/bin/screenshot awful.key({ altkey }, "p", function() os.execute("screenshot") end, @@ -507,7 +507,7 @@ globalkeys = awful.util.table.join( --]] ) -clientkeys = awful.util.table.join( +clientkeys = gears.table.join( awful.key({ altkey, "Shift" }, "m", lain.util.magnify_client, {description = "magnify client", group = "client"}), awful.key({ modkey, }, "f", @@ -553,7 +553,7 @@ for i = 1, 9 do descr_move = {description = "move focused client to tag #", group = "tag"} descr_toggle_focus = {description = "toggle focused client on tag #", group = "tag"} end - globalkeys = awful.util.table.join(globalkeys, + globalkeys = gears.table.join(globalkeys, -- View tag only. awful.key({ modkey }, "#" .. i + 9, function () @@ -599,7 +599,7 @@ for i = 1, 9 do ) end -clientbuttons = awful.util.table.join( +clientbuttons = gears.table.join( awful.button({ }, 1, function (c) client.focus = c; c:raise() end), awful.button({ modkey }, 1, awful.mouse.client.move), awful.button({ modkey }, 3, awful.mouse.client.resize)) @@ -663,7 +663,7 @@ client.connect_signal("request::titlebars", function(c) -- Default -- buttons for the titlebar - local buttons = awful.util.table.join( + local buttons = gears.table.join( awful.button({ }, 1, function() client.focus = c c:raise() diff --git a/themes/blackburn/theme.lua b/themes/blackburn/theme.lua index 88a4aab..16f5a70 100644 --- a/themes/blackburn/theme.lua +++ b/themes/blackburn/theme.lua @@ -222,7 +222,7 @@ function theme.at_screen_connect(s) -- Create an imagebox widget which will contains an icon indicating which layout we're using. -- We need one layoutbox per screen. s.mylayoutbox = awful.widget.layoutbox(s) - s.mylayoutbox:buttons(awful.util.table.join( + 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), diff --git a/themes/copland/theme.lua b/themes/copland/theme.lua index 4e8b8e8..7484a01 100644 --- a/themes/copland/theme.lua +++ b/themes/copland/theme.lua @@ -252,7 +252,7 @@ theme.volume = lain.widget.alsabar({ } }) theme.volume.tooltip.wibox.fg = theme.fg_focus -theme.volume.bar:buttons(awful.util.table.join ( +theme.volume.bar:buttons(gears.table.join ( awful.button({}, 1, function() awful.spawn.with_shell(string.format("%s -e alsamixer", awful.util.terminal)) end), @@ -316,7 +316,7 @@ function theme.at_screen_connect(s) -- Create an imagebox widget which will contains an icon indicating which layout we're using. -- We need one layoutbox per screen. s.mylayoutbox = awful.widget.layoutbox(s) - s.mylayoutbox:buttons(awful.util.table.join( + 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), diff --git a/themes/dremora/theme.lua b/themes/dremora/theme.lua index e8c7518..c1eff2a 100644 --- a/themes/dremora/theme.lua +++ b/themes/dremora/theme.lua @@ -204,7 +204,7 @@ function theme.at_screen_connect(s) -- Create an imagebox widget which will contains an icon indicating which layout we're using. -- We need one layoutbox per screen. s.mylayoutbox = awful.widget.layoutbox(s) - s.mylayoutbox:buttons(awful.util.table.join( + 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), diff --git a/themes/holo/theme.lua b/themes/holo/theme.lua index bcfb2f1..b33b0da 100644 --- a/themes/holo/theme.lua +++ b/themes/holo/theme.lua @@ -174,25 +174,25 @@ theme.mpd = lain.widget.mpd({ local musicbg = wibox.container.background(theme.mpd.widget, theme.bg_focus, gears.shape.rectangle) local musicwidget = wibox.container.margin(musicbg, 0, 0, 5, 5) -musicwidget:buttons(awful.util.table.join(awful.button({ }, 1, +musicwidget:buttons(gears.table.join(awful.button({ }, 1, function () awful.spawn(theme.musicplr) end))) -prev_icon:buttons(awful.util.table.join(awful.button({}, 1, +prev_icon:buttons(gears.table.join(awful.button({}, 1, function () awful.spawn.with_shell("mpc prev") theme.mpd.update() end))) -next_icon:buttons(awful.util.table.join(awful.button({}, 1, +next_icon:buttons(gears.table.join(awful.button({}, 1, function () awful.spawn.with_shell("mpc next") theme.mpd.update() end))) -stop_icon:buttons(awful.util.table.join(awful.button({}, 1, +stop_icon:buttons(gears.table.join(awful.button({}, 1, function () play_pause_icon:set_image(theme.play) awful.spawn.with_shell("mpc stop") theme.mpd.update() end))) -play_pause_icon:buttons(awful.util.table.join(awful.button({}, 1, +play_pause_icon:buttons(gears.table.join(awful.button({}, 1, function () awful.spawn.with_shell("mpc toggle") theme.mpd.update() @@ -303,7 +303,7 @@ function theme.at_screen_connect(s) -- Create an imagebox widget which will contains an icon indicating which layout we're using. -- We need one layoutbox per screen. s.mylayoutbox = awful.widget.layoutbox(s) - s.mylayoutbox:buttons(awful.util.table.join( + 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), diff --git a/themes/multicolor/theme.lua b/themes/multicolor/theme.lua index 3ba507f..426b254 100644 --- a/themes/multicolor/theme.lua +++ b/themes/multicolor/theme.lua @@ -268,7 +268,7 @@ function theme.at_screen_connect(s) -- Create an imagebox widget which will contains an icon indicating which layout we're using. -- We need one layoutbox per screen. s.mylayoutbox = awful.widget.layoutbox(s) - s.mylayoutbox:buttons(awful.util.table.join( + 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), diff --git a/themes/powerarrow-dark/theme.lua b/themes/powerarrow-dark/theme.lua index 0dda79b..797d364 100644 --- a/themes/powerarrow-dark/theme.lua +++ b/themes/powerarrow-dark/theme.lua @@ -110,7 +110,7 @@ theme.cal = lain.widget.calendar({ -- Mail IMAP check local mailicon = wibox.widget.imagebox(theme.widget_mail) --[[ commented because it needs to be set before use -mailicon:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.spawn(mail) end))) +mailicon:buttons(gears.table.join(awful.button({ }, 1, function () awful.spawn(mail) end))) local mail = lain.widget.imap({ timeout = 180, server = "server", @@ -131,7 +131,7 @@ local mail = lain.widget.imap({ -- MPD local musicplr = awful.util.terminal .. " -title Music -g 130x34-320+16 -e ncmpcpp" local mpdicon = wibox.widget.imagebox(theme.widget_music) -mpdicon:buttons(awful.util.table.join( +mpdicon:buttons(gears.table.join( awful.button({ modkey }, 1, function () awful.spawn.with_shell(musicplr) end), awful.button({ }, 1, function () awful.spawn.with_shell("mpc prev") @@ -275,7 +275,7 @@ function theme.at_screen_connect(s) -- Create an imagebox widget which will contains an icon indicating which layout we're using. -- We need one layoutbox per screen. s.mylayoutbox = awful.widget.layoutbox(s) - s.mylayoutbox:buttons(awful.util.table.join( + 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), diff --git a/themes/powerarrow/theme.lua b/themes/powerarrow/theme.lua index 923fec0..87a23e9 100644 --- a/themes/powerarrow/theme.lua +++ b/themes/powerarrow/theme.lua @@ -122,16 +122,16 @@ lain.widget.contrib.task.attach(task, { -- do not colorize output show_cmd = "task | sed -r 's/\\x1B\\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g'" }) -task:buttons(awful.util.table.join(awful.button({}, 1, lain.widget.contrib.task.prompt))) +task:buttons(gears.table.join(awful.button({}, 1, lain.widget.contrib.task.prompt))) -- Scissors (xsel copy and paste) local scissors = wibox.widget.imagebox(theme.widget_scissors) -scissors:buttons(awful.util.table.join(awful.button({}, 1, function() awful.spawn("xsel | xsel -i -b") end))) +scissors:buttons(gears.table.join(awful.button({}, 1, function() awful.spawn("xsel | xsel -i -b") end))) -- Mail IMAP check local mailicon = wibox.widget.imagebox(theme.widget_mail) --[[ commented because it needs to be set before use -mailicon:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.spawn(mail) end))) +mailicon:buttons(gears.table.join(awful.button({ }, 1, function () awful.spawn(mail) end))) local mail = lain.widget.imap({ timeout = 180, server = "server", @@ -158,7 +158,7 @@ theme.volume = lain.widget.alsabar({ -- MPD local musicplr = awful.util.terminal .. " -title Music -g 130x34-320+16 -e ncmpcpp" local mpdicon = wibox.widget.imagebox(theme.widget_music) -mpdicon:buttons(awful.util.table.join( +mpdicon:buttons(gears.table.join( awful.button({ modkey }, 1, function () awful.spawn.with_shell(musicplr) end), awful.button({ }, 1, function () awful.spawn.with_shell("mpc prev") @@ -311,7 +311,7 @@ function theme.at_screen_connect(s) -- Create an imagebox widget which will contains an icon indicating which layout we're using. -- We need one layoutbox per screen. s.mylayoutbox = awful.widget.layoutbox(s) - s.mylayoutbox:buttons(awful.util.table.join( + 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), diff --git a/themes/rainbow/theme.lua b/themes/rainbow/theme.lua index 2941e30..fbd64f7 100644 --- a/themes/rainbow/theme.lua +++ b/themes/rainbow/theme.lua @@ -167,7 +167,7 @@ theme.volume = lain.widget.alsabar({ }) theme.volume.tooltip.wibox.fg = theme.fg_focus theme.volume.tooltip.wibox.font = theme.font -theme.volume.bar:buttons(awful.util.table.join ( +theme.volume.bar:buttons(gears.table.join ( awful.button({}, 1, function() awful.spawn.with_shell(string.format("%s -e alsamixer", terminal)) end), @@ -228,7 +228,7 @@ function theme.at_screen_connect(s) s.mytxtlayoutbox = wibox.widget.textbox(theme["layout_txt_" .. awful.layout.getname(awful.layout.get(s))]) awful.tag.attached_connect_signal(s, "property::selected", function () update_txt_layoutbox(s) end) awful.tag.attached_connect_signal(s, "property::layout", function () update_txt_layoutbox(s) end) - s.mytxtlayoutbox:buttons(awful.util.table.join( + s.mytxtlayoutbox: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), diff --git a/themes/steamburn/theme.lua b/themes/steamburn/theme.lua index 063b30a..b08bf0f 100644 --- a/themes/steamburn/theme.lua +++ b/themes/steamburn/theme.lua @@ -222,7 +222,7 @@ function theme.at_screen_connect(s) s.mytxtlayoutbox = wibox.widget.textbox(theme["layout_txt_" .. awful.layout.getname(awful.layout.get(s))]) awful.tag.attached_connect_signal(s, "property::selected", function () update_txt_layoutbox(s) end) awful.tag.attached_connect_signal(s, "property::layout", function () update_txt_layoutbox(s) end) - s.mytxtlayoutbox:buttons(awful.util.table.join( + s.mytxtlayoutbox: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), diff --git a/themes/vertex/theme.lua b/themes/vertex/theme.lua index 909445b..ac2eac8 100644 --- a/themes/vertex/theme.lua +++ b/themes/vertex/theme.lua @@ -205,7 +205,7 @@ theme.volume = lain.widget.alsabar({ volicon:set_image(theme[index]) end }) -volicon:buttons(awful.util.table.join ( +volicon:buttons(gears.table.join ( awful.button({}, 1, function() awful.spawn.with_shell(string.format("%s -e alsamixer", awful.util.terminal)) end), @@ -404,7 +404,7 @@ function theme.at_screen_connect(s) -- Create an imagebox widget which will contains an icon indicating which layout we're using. -- We need one layoutbox per screen. s.mylayoutbox = awful.widget.layoutbox(s) - s.mylayoutbox:buttons(awful.util.table.join( + 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), From a946a59e9c7cb4d37cddb0573ea74c112f62270c Mon Sep 17 00:00:00 2001 From: cool-cool-sweat <35659567+cool-cool-sweat@users.noreply.github.com> Date: Mon, 22 Jan 2018 05:57:13 -0500 Subject: [PATCH 2/2] Handle client border when un/maximising --- rc.lua.template | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/rc.lua.template b/rc.lua.template index 9c4b14b..335291a 100644 --- a/rc.lua.template +++ b/rc.lua.template @@ -711,14 +711,16 @@ client.connect_signal("mouse::enter", function(c) end) -- No border for maximized clients -client.connect_signal("focus", - function(c) - if c.maximized then -- no borders if only 1 client visible - c.border_width = 0 - elseif #awful.screen.focused().clients > 1 then - c.border_width = beautiful.border_width - c.border_color = beautiful.border_focus - end - end) +function border_adjust(c) + if c.maximized then -- no borders if only 1 client visible + c.border_width = 0 + elseif #awful.screen.focused().clients > 1 then + c.border_width = beautiful.border_width + c.border_color = beautiful.border_focus + end +end + +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) -- }}}