Skip to content

Instantly share code, notes, and snippets.

@erikLundstedt
Created October 5, 2020 12:52
Show Gist options
  • Save erikLundstedt/37ff8f136a2dce9daecb402858ee0c4d to your computer and use it in GitHub Desktop.
Save erikLundstedt/37ff8f136a2dce9daecb402858ee0c4d to your computer and use it in GitHub Desktop.
awesome swallow alfa
--https://www.reddit.com/r/awesomewm/comments/h07f5y/does_awesome_support_window_swallowing/
function isFood(c)
if (c.class and c.class:match("Vivaldi-stable")) and true or false then
notify("vivaldi")
return true
elseif( c.class and c.class:match("kitty")) and true or false then
notify("kitty")
return true
else
return (c.class and c.class:match("kitty") or c.class:match("Vivaldi-stable")) and true or false
end
end
function copySize(c, parent_client)
if not c or not parent_client then
return
end
if not c.valid or not parent_client.valid then
return
end
c.x=parent_client.x;
c.y=parent_client.y;
c.width=parent_client.width;
c.height=parent_client.height;
end
function check_resize_client(c)
if(c.child_resize) then
copy_size(c.child_resize, c)
end
end
client.connect_signal("property::size", check_resize_client)
client.connect_signal("property::position", check_resize_client)
client.connect_signal("manage", function(c)
if isFood(c) then
return
end
local parent_client=awful.client.focus.history.get(c.screen, 1)
if parent_client and isFood(parent_client) then
parent_client.minimized = true
c.floating=false
c.fullscreen = not c.fullscreen
c:raise()
c:connect_signal("unmanage", function() parent_client.minimized = false end)
-- c.floating=true
-- copy_size(c, parent_client)
end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment