From f90e2ea391b1f39e30f5c07a0305151406586487 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Fri, 22 Jun 2018 12:35:51 +0200 Subject: Make sure windows are spawned on the current tag. --- bindings.lua | 6 +++--- utils.lua | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bindings.lua b/bindings.lua index 05217b7..98ecb85 100644 --- a/bindings.lua +++ b/bindings.lua @@ -12,9 +12,9 @@ function M.create(workspace) awful.key({ modkey }, "Pause", function () awful.util.spawn("xscreensaver-command -lock") end), -- program launching - awful.key({ modkey, }, "t", function () awful.util.spawn(commondefs.terminal) end), - awful.key({ modkey, }, "v", function () awful.util.spawn(commondefs.terminal .. " -e alsamixer") end), - awful.key({ modkey, }, "Escape", function () awful.util.spawn(commondefs.terminal .. " -e htop") end), + awful.key({ modkey, }, "t", function () utils.spawn_current(commondefs.terminal) end), + awful.key({ modkey, }, "v", function () utils.spawn_current(commondefs.terminal .. " -e alsamixer") end), + awful.key({ modkey, }, "Escape", function () utils.spawn_current(commondefs.terminal .. " -e htop") end), -- audio control awful.key({ modkey }, "Prior", function () utils.vol_control(1) end), diff --git a/utils.lua b/utils.lua index a29a50f..bd3516d 100644 --- a/utils.lua +++ b/utils.lua @@ -35,4 +35,8 @@ function M.vol_control(n) awful.util.spawn(cmd) end +function M.spawn_current(command) + awful.spawn(command, {tag = mouse.screen.selected_tag}) +end + return M -- cgit v1.2.3