From 17c115d52c3a4958af9cb3c7dfad4ea7a050982e Mon Sep 17 00:00:00 2001 From: Sorky <43520033+Sorky@users.noreply.github.com> Date: Sun, 4 Nov 2018 17:10:18 +1100 Subject: [PATCH] Add mouse-middle-click on layout box icon Middle-click to go straight to the first layout --- themes/blackburn/theme.lua | 10 ++++++---- themes/copland/theme.lua | 9 +++++---- themes/dremora/theme.lua | 9 +++++---- themes/holo/theme.lua | 9 +++++---- themes/multicolor/theme.lua | 9 +++++---- themes/powerarrow-dark/theme.lua | 9 +++++---- themes/powerarrow/theme.lua | 9 +++++---- themes/rainbow/theme.lua | 1 + themes/steamburn/theme.lua | 1 + themes/vertex/theme.lua | 9 +++++---- 10 files changed, 43 insertions(+), 32 deletions(-) diff --git a/themes/blackburn/theme.lua b/themes/blackburn/theme.lua index 8b33621..3179653 100644 --- a/themes/blackburn/theme.lua +++ b/themes/blackburn/theme.lua @@ -226,10 +226,12 @@ function theme.at_screen_connect(s) -- We need one layoutbox per screen. s.mylayoutbox = awful.widget.layoutbox(s) s.mylayoutbox:buttons(my_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))) + awful.button({}, 1, function () awful.layout.inc( 1) end), + awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[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, awful.widget.taglist.filter.all, awful.util.taglist_buttons) diff --git a/themes/copland/theme.lua b/themes/copland/theme.lua index 2a38bf8..d3ec23b 100644 --- a/themes/copland/theme.lua +++ b/themes/copland/theme.lua @@ -318,10 +318,11 @@ function theme.at_screen_connect(s) -- We need one layoutbox per screen. s.mylayoutbox = awful.widget.layoutbox(s) s.mylayoutbox:buttons(my_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))) + awful.button({}, 1, function () awful.layout.inc( 1) end), + awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[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, awful.widget.taglist.filter.all, awful.util.taglist_buttons) diff --git a/themes/dremora/theme.lua b/themes/dremora/theme.lua index 612e16e..fee78fe 100644 --- a/themes/dremora/theme.lua +++ b/themes/dremora/theme.lua @@ -207,10 +207,11 @@ function theme.at_screen_connect(s) -- We need one layoutbox per screen. s.mylayoutbox = awful.widget.layoutbox(s) s.mylayoutbox:buttons(my_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))) + awful.button({}, 1, function () awful.layout.inc( 1) end), + awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[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, awful.widget.taglist.filter.all, awful.util.taglist_buttons) diff --git a/themes/holo/theme.lua b/themes/holo/theme.lua index 07e7c6c..e93c33d 100644 --- a/themes/holo/theme.lua +++ b/themes/holo/theme.lua @@ -304,10 +304,11 @@ function theme.at_screen_connect(s) -- We need one layoutbox per screen. s.mylayoutbox = awful.widget.layoutbox(s) s.mylayoutbox:buttons(my_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))) + awful.button({}, 1, function () awful.layout.inc( 1) end), + awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[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, awful.widget.taglist.filter.all, awful.util.taglist_buttons, { bg_focus = barcolor }) diff --git a/themes/multicolor/theme.lua b/themes/multicolor/theme.lua index 2778a96..565b841 100644 --- a/themes/multicolor/theme.lua +++ b/themes/multicolor/theme.lua @@ -270,10 +270,11 @@ function theme.at_screen_connect(s) -- We need one layoutbox per screen. s.mylayoutbox = awful.widget.layoutbox(s) s.mylayoutbox:buttons(my_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))) + awful.button({}, 1, function () awful.layout.inc( 1) end), + awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[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, awful.widget.taglist.filter.all, awful.util.taglist_buttons) diff --git a/themes/powerarrow-dark/theme.lua b/themes/powerarrow-dark/theme.lua index f2454a4..07ea51a 100644 --- a/themes/powerarrow-dark/theme.lua +++ b/themes/powerarrow-dark/theme.lua @@ -277,10 +277,11 @@ function theme.at_screen_connect(s) -- We need one layoutbox per screen. s.mylayoutbox = awful.widget.layoutbox(s) s.mylayoutbox:buttons(my_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))) + awful.button({}, 1, function () awful.layout.inc( 1) end), + awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[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, awful.widget.taglist.filter.all, awful.util.taglist_buttons) diff --git a/themes/powerarrow/theme.lua b/themes/powerarrow/theme.lua index 4463d59..c21f8fc 100644 --- a/themes/powerarrow/theme.lua +++ b/themes/powerarrow/theme.lua @@ -316,10 +316,11 @@ function theme.at_screen_connect(s) -- We need one layoutbox per screen. s.mylayoutbox = awful.widget.layoutbox(s) s.mylayoutbox:buttons(my_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))) + awful.button({}, 1, function () awful.layout.inc( 1) end), + awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[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, awful.widget.taglist.filter.all, awful.util.taglist_buttons) diff --git a/themes/rainbow/theme.lua b/themes/rainbow/theme.lua index 5817663..3402c5e 100644 --- a/themes/rainbow/theme.lua +++ b/themes/rainbow/theme.lua @@ -231,6 +231,7 @@ function theme.at_screen_connect(s) awful.tag.attached_connect_signal(s, "property::layout", function () update_txt_layoutbox(s) end) s.mytxtlayoutbox:buttons(my_table.join( awful.button({}, 1, function() awful.layout.inc(1) end), + awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[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))) diff --git a/themes/steamburn/theme.lua b/themes/steamburn/theme.lua index 65d0a3f..acb709d 100644 --- a/themes/steamburn/theme.lua +++ b/themes/steamburn/theme.lua @@ -227,6 +227,7 @@ function theme.at_screen_connect(s) awful.tag.attached_connect_signal(s, "property::layout", function () update_txt_layoutbox(s) end) s.mytxtlayoutbox:buttons(my_table.join( awful.button({}, 1, function() awful.layout.inc(1) end), + awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[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))) diff --git a/themes/vertex/theme.lua b/themes/vertex/theme.lua index ef32eb1..50caa72 100644 --- a/themes/vertex/theme.lua +++ b/themes/vertex/theme.lua @@ -407,10 +407,11 @@ function theme.at_screen_connect(s) -- We need one layoutbox per screen. s.mylayoutbox = awful.widget.layoutbox(s) s.mylayoutbox:buttons(my_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))) + awful.button({}, 1, function () awful.layout.inc( 1) end), + awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[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))) s.layoutb = wibox.container.margin(s.mylayoutbox, 8, 11, 3, 3) -- Create a taglist widget