From b6722f6fcc29e2c93b82315454c41087fb25170d Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Sat, 9 Nov 2024 17:18:20 -0600 Subject: move mouse.lua to buttons.lua to distinguish between builtin mouse module --- buttons.lua | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ mouse.lua | 47 ----------------------------------------------- 2 files changed, 48 insertions(+), 47 deletions(-) create mode 100644 buttons.lua delete mode 100644 mouse.lua diff --git a/buttons.lua b/buttons.lua new file mode 100644 index 0000000..8b4a867 --- /dev/null +++ b/buttons.lua @@ -0,0 +1,48 @@ +local awful = require("awful") +local gears = require("gears") +local volume_control = require("widgets.pavolctld") + +local super = "Mod4" +local alt = "Mod1" +local shift = "Shift" +local ctrl = "Control" + +--root.buttons(gears.table.join( +-- awful.button({ }, 3, function () mymainmenu:toggle() end), +-- awful.button({ }, 4, awful.tag.viewnext), +-- awful.button({ }, 5, awful.tag.viewprev) +--)) + +-- window buttons +client_buttons = gears.table.join( + awful.button({ }, 1, function (c) c:emit_signal("request::activate", "mouse_click", {raise = true}) end), + awful.button({ super }, 1, function (c) c:emit_signal("request::activate", "mouse_click", {raise = true}) awful.mouse.client.move(c) end), + awful.button({ super }, 3, function (c) c:emit_signal("request::activate", "mouse_click", {raise = true}) awful.mouse.client.resize(c) end) +) + +-- wibar widgets +layout_buttons = gears.table.join( + awful.button({ }, 1, function() awful.layout.inc(1, awful.screen.focused().tags[0]) end) +) + +taglist_buttons = gears.table.join( + awful.button({ }, 1, function(t) t:view_only() end), + awful.button({ modkey }, 1, function(t) if client.focus then client.focus:move_to_tag(t) end end), + awful.button({ }, 3, awful.tag.viewtoggle), + awful.button({ modkey }, 3, function(t) if client.focus then client.focus:toggle_tag(t) end end), + awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end), + awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end) +) + +tasklist_buttons = gears.table.join( + awful.button({ }, 1, function (c) c:emit_signal("request::activate", "tasklist", {raise = true}) end), + --awful.button({ }, 3, function() awful.menu.client_list({ theme = { width = 250 } }) end), + awful.button({ }, 4, function () awful.client.focus.byidx(1) end), + awful.button({ }, 5, function () awful.client.focus.byidx(-1) end) +) + +volume_buttons = gears.table.join( + awful.button({ }, 4, function() volume_control.volume_inc(5) end), + awful.button({ }, 5, function() volume_control.volume_dec(5) end) +) + diff --git a/mouse.lua b/mouse.lua deleted file mode 100644 index 13165db..0000000 --- a/mouse.lua +++ /dev/null @@ -1,47 +0,0 @@ -local awful = require("awful") -local gears = require("gears") -local volume_control = require("widgets.pavolctld") - -local super = "Mod4" -local alt = "Mod1" -local shift = "Shift" -local ctrl = "Control" - --- window buttons -clientbuttons = gears.table.join( - awful.button({ }, 1, function (c) c:emit_signal("request::activate", "mouse_click", {raise = true}) end), - awful.button({ super }, 1, function (c) c:emit_signal("request::activate", "mouse_click", {raise = true}) awful.mouse.client.move(c) end), - awful.button({ super }, 3, function (c) c:emit_signal("request::activate", "mouse_click", {raise = true}) awful.mouse.client.resize(c) end) -) - ---root.buttons(gears.table.join( --- awful.button({ }, 3, function () mymainmenu:toggle() end), --- awful.button({ }, 4, awful.tag.viewnext), --- awful.button({ }, 5, awful.tag.viewprev) ---)) - --- wibar widgets -layout_buttons = gears.table.join( - awful.button({ }, 1, function() awful.layout.inc(1, awful.screen.focused().tags[0]) end) -) - -taglist_buttons = gears.table.join( - awful.button({ }, 1, function(t) t:view_only() end), - awful.button({ modkey }, 1, function(t) if client.focus then client.focus:move_to_tag(t) end end), - awful.button({ }, 3, awful.tag.viewtoggle), - awful.button({ modkey }, 3, function(t) if client.focus then client.focus:toggle_tag(t) end end), - awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end), - awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end) -) - -tasklist_buttons = gears.table.join( - awful.button({ }, 1, function (c) c:emit_signal("request::activate", "tasklist", {raise = true}) end), - --awful.button({ }, 3, function() awful.menu.client_list({ theme = { width = 250 } }) end), - awful.button({ }, 4, function () awful.client.focus.byidx(1) end), - awful.button({ }, 5, function () awful.client.focus.byidx(-1) end) -) - -volume_buttons = gears.table.join( - awful.button({ }, 4, function() volume_control.volume_inc(5) end), - awful.button({ }, 5, function() volume_control.volume_dec(5) end) -) -- cgit v1.2.3