1
0
Fork 0
mirror of https://github.com/lcpz/awesome-copycats.git synced 2026-03-23 22:15:11 +00:00

fix floating

This commit is contained in:
Crescent617 2024-05-11 14:43:15 +08:00
parent 6fdb2e1568
commit 13cdb9a290

20
rc.lua
View file

@ -113,7 +113,7 @@ awful.util.tagnames = { "1: ", "2:</>", "3: ", "4: ", "5:󰊠 " }
awful.layout.layouts = { awful.layout.layouts = {
awful.layout.suit.spiral, awful.layout.suit.spiral,
--awful.layout.suit.spiral.dwindle, --awful.layout.suit.spiral.dwindle,
-- awful.layout.suit.floating, awful.layout.suit.floating,
-- awful.layout.suit.tile, -- awful.layout.suit.tile,
-- awful.layout.suit.tile.left, -- awful.layout.suit.tile.left,
-- awful.layout.suit.tile.bottom, -- awful.layout.suit.tile.bottom,
@ -476,8 +476,8 @@ globalkeys = mytable.join(
-- awful.layout.inc(1) -- awful.layout.inc(1)
-- end, { description = "select next", group = "layout" }), -- end, { description = "select next", group = "layout" }),
awful.key({ modkey, "Shift" }, "space", function() awful.key({ modkey, "Shift" }, "space", function()
awful.layout.inc(-1) awful.layout.inc(1)
end, { description = "select previous", group = "layout" }), end, { description = "select next", group = "layout" }),
-- Screen brightness -- Screen brightness
awful.key({}, "XF86MonBrightnessUp", function() awful.key({}, "XF86MonBrightnessUp", function()
@ -695,7 +695,7 @@ for i = 1, 9 do
) )
end end
clientbuttons = mytable.join( local clientbuttons = mytable.join(
awful.button({}, 1, function(c) awful.button({}, 1, function(c)
c:emit_signal("request::activate", "mouse_click", { raise = true }) c:emit_signal("request::activate", "mouse_click", { raise = true })
end), end),
@ -777,7 +777,6 @@ awful.rules.rules = {
rule_any = { type = { "normal", "dialog" } }, rule_any = { type = { "normal", "dialog" } },
properties = { titlebars_enabled = true }, properties = { titlebars_enabled = true },
}, },
-- Set Firefox to always map on the tag named "2" on screen 1. -- Set Firefox to always map on the tag named "2" on screen 1.
-- { rule = { class = "Firefox" }, -- { rule = { class = "Firefox" },
-- properties = { screen = 1, tag = "2" } }, -- properties = { screen = 1, tag = "2" } },
@ -786,6 +785,10 @@ awful.rules.rules = {
-- }}} -- }}}
-- {{{ Signals -- {{{ Signals
local function is_floating_layout()
local current_layout = awful.layout.getname(awful.layout.get())
return current_layout == "floating"
end
-- Signal function to execute when a new client appears. -- Signal function to execute when a new client appears.
client.connect_signal("manage", function(c) client.connect_signal("manage", function(c)
@ -797,6 +800,13 @@ client.connect_signal("manage", function(c)
-- Prevent clients from being unreachable after screen count changes. -- Prevent clients from being unreachable after screen count changes.
awful.placement.no_offscreen(c) awful.placement.no_offscreen(c)
end end
-- set floating to true, when layout is floating
if is_floating_layout() then
c.floating = true
end
if c.floating then
awful.placement.centered(c)
end
end) end)
-- Add a titlebar if titlebars_enabled is set to true in the rules. -- Add a titlebar if titlebars_enabled is set to true in the rules.