fix moving after mouse/key

This commit is contained in:
Kolan Sh 2022-01-28 19:46:48 +03:00
parent 0d1b07e167
commit f190b4320e
1 changed files with 38 additions and 15 deletions

53
rc.lua
View File

@ -311,13 +311,7 @@ vicious.register(disk, vicious.widgets.fs, '<span color="#E68347">${/ avail_gb}/
disk:buttons(diskicon:buttons()) disk:buttons(diskicon:buttons())
local mywibox_height = 14.5 local mywibox_height = 14.5
local function update_quake_console(cli) local function update_quake_console_real(cli)
if cli == nil then
for c in awful.client.iterate(function (c) return string.find(c.instance, "QuakeConsole") end)
do cli = c end
end
if cli == nil then return end
if (not cli.hidden) then if (not cli.hidden) then
cli.floating = true cli.floating = true
if not cli.fullscreen then cli.ontop = true end if not cli.fullscreen then cli.ontop = true end
@ -327,6 +321,16 @@ local function update_quake_console(cli)
client.focus = cli client.focus = cli
end end
end end
local function update_quake_console(cli)
if cli == nil then
for c in awful.client.iterate(function (c) return string.find(c.instance, "QuakeConsole") end)
do
update_quake_console_real(c)
end
else
update_quake_console_real(cli)
end
end
----< Wibar >-------------------------------------------------- ----< Wibar >--------------------------------------------------
-- --
@ -338,7 +342,10 @@ mytextclock:buttons(gears.table.join(awful.button({ }, 1,
-- Create a wibox for each screen and add it -- Create a wibox for each screen and add it
local taglist_buttons = gears.table.join( local taglist_buttons = gears.table.join(
awful.button({ }, 1, function(t) t:view_only() end), awful.button({ }, 1, function(t)
t:view_only()
update_quake_console()
end),
awful.button({ modkey }, 1, function(t) awful.button({ modkey }, 1, function(t)
if client.focus then if client.focus then
client.focus:move_to_tag(t) client.focus:move_to_tag(t)
@ -350,8 +357,14 @@ local taglist_buttons = gears.table.join(
client.focus:toggle_tag(t) client.focus:toggle_tag(t)
end end
end), end),
awful.button({ }, 4, function(t) awful.tag.viewprev(t.screen) end), awful.button({ }, 4, function(t)
awful.button({ }, 5, function(t) awful.tag.viewnext(t.screen) end) awful.tag.viewprev(t.screen)
update_quake_console()
end),
awful.button({ }, 5, function(t)
awful.tag.viewnext(t.screen)
update_quake_console()
end)
) )
local tasklist_buttons = gears.table.join( local tasklist_buttons = gears.table.join(
@ -473,8 +486,8 @@ end)
-- --
root.buttons(gears.table.join( root.buttons(gears.table.join(
awful.button({ }, 3, function () mymainmenu:toggle() end), awful.button({ }, 3, function () mymainmenu:toggle() end),
awful.button({ }, 4, awful.tag.viewprev), awful.button({ }, 4, function () awful.tag.viewprev(); update_quake_console() end),
awful.button({ }, 5, awful.tag.viewnext) awful.button({ }, 5, function () awful.tag.viewnext(); update_quake_console() end)
)) ))
----< Key bindings >-------------------------------------------------- ----< Key bindings >--------------------------------------------------
@ -482,11 +495,20 @@ root.buttons(gears.table.join(
globalkeys = gears.table.join( globalkeys = gears.table.join(
awful.key({ modkey, }, "s", hotkeys_popup.show_help, awful.key({ modkey, }, "s", hotkeys_popup.show_help,
{description="show help", group="awesome"}), {description="show help", group="awesome"}),
awful.key({ modkey, }, "[", awful.tag.viewprev, awful.key({ modkey, }, "[", function ()
awful.tag.viewprev()
update_quake_console()
end,
{description = "view previous", group = "tag"}), {description = "view previous", group = "tag"}),
awful.key({ modkey, }, "]", awful.tag.viewnext, awful.key({ modkey, }, "]", function ()
awful.tag.viewnext()
update_quake_console()
end,
{description = "view next", group = "tag"}), {description = "view next", group = "tag"}),
awful.key({ modkey, }, "Escape", awful.tag.history.restore, awful.key({ modkey, }, "Escape", function()
awful.tag.history.restore()
update_quake_console()
end,
{description = "go back", group = "tag"}), {description = "go back", group = "tag"}),
awful.key({ modkey, }, "k", awful.key({ modkey, }, "k",
@ -688,6 +710,7 @@ for i = 1, 10 do
if tag then if tag then
tag:view_only() tag:view_only()
end end
update_quake_console()
end, end,
{description = "view tag #"..i, group = "tag"}), {description = "view tag #"..i, group = "tag"}),
-- Toggle tag display. -- Toggle tag display.