You are not logged in.
Is there any way to add a titlebar just for floating apps?
Offline
I have nothing to add, I don't use awesome and don't know lua but this is a great idea, one that I've been thinking about lately. I know it should be easily done in Awesome, but some awesome user will have to confirm/show how.
Perhaps something like this could be possible with Xmonad as well... but I don't know haskell either
Damn, I'll learn these two as soon as I get the time...promise!
Last edited by moljac024 (2009-05-31 12:50:17)
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
I've made a initial hack on this, but it's not perfect. It'll work for apps that are in your floatapps[] at the beginning of rc.lua, but it won't for apps that start in tiling mode and then you send it to float with Ctrl+Mod+Space.
In 'awful.hooks.manage.register', search for this and add the lines marked with a ->:
-- Check if the application should be floating.
local cls = c.class
local inst = c.instance
if floatapps[cls] then
awful.client.floating.set(c, floatapps[cls])
-> awful.titlebar.add(c, { modkey = modkey })
elseif floatapps[inst] then
awful.client.floating.set(c, floatapps[inst])
-> awful.titlebar.add(c, { modkey = modkey })
end
(lambda ())
Offline
Isn't there a hook that this sort of thing could be done with ?
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
I guess it should be 'awful.hooks.arrange' but I'm not sure how to check if a client is floating. I've tried
awful.hooks.arrange.register(function (screen)
local layout = awful.layout.getname(awful.layout.get(screen))
if layout and beautiful["layout_" ..layout] then
mylayoutbox[screen].image = image(beautiful["layout_" .. layout])
else
mylayoutbox[screen].image = nil
end
if awful.client.floating.get(client) then
awful.titlebar.add(client, { modkey = modkey })
else
awful.titlebar.remove(client)
end
-- Give focus to the latest client in history if no window has focus
-- or if the current window is a desktop or a dock one.
if not client.focus then
local c = awful.client.focus.history.get(screen, 0)
if c then client.focus = c end
end
end)
But it didn't work.
(lambda ())
Offline
Great idea,
I can't test this currently but I've found discussion
Maybe it helps you (and maybe you can post how you finally solved it)
Offline
Thanks Barghest. The last e-mail from this link helps a lot, though it only works with apps that are in "floatapps" (in the beginning of the file). I've made some changes, so it works with any app that is floating, it doesn't matter if the app is in "floatapps" or not.
Add this to the end of the file:
awful.hooks.property.register(function (c, prop)
-- Remove the titlebar if fullscreen
if c.fullscreen then
awful.titlebar.remove(c)
elseif not c.fullscreen then
-- Add title bar for floating apps
if c.titlebar == nil and awful.client.floating.get(c) then
awful.titlebar.add(c, { modkey = modkey })
-- Remove title bar, if it's not floating
elseif c.titlebar and not awful.client.floating.get(c) then
awful.titlebar.remove(c)
end
end
end)
It's not perfect, though. I don't know why, Firefox is always floating, so there's always a titlebar in it. I've tried using 'and c.class ~= 'Firefox'", but then everything stopped working.
(lambda ())
Offline
I've been struggling with this for a long time, but never figured it out. Thanks!
Please post if you figure out a perfect hack!!
EDIT: I just notice that this hack work as expected. all floating apps have title bar. btw firefox isn't floating here
Last edited by jerryluc (2009-06-02 21:26:34)
Offline
Both Firefox and Epiphany are floating here, I don't know why. And even if I try to make them tile again using modkey+ctrl+space, nothing changes.
Anyway, does anyone here have an account in Awesome's wiki? I think it would be nice to have this little hack there.
(lambda ())
Offline