You are not logged in.

#1 2012-06-07 07:43:57

mt22
Member
Registered: 2012-03-31
Posts: 20

Awesome WM, how to remove the title bar in specific applications

I want to have title bars in all my windows while I don't want to have the title bar in Chromium for example.

I've this in my rc.lua:

awful.rules.rules = {
    -- All clients will match this rule.
    { rule = { },
      properties = { border_width = beautiful.border_width,
                     border_color = beautiful.border_normal,
                     focus = true,
                     keys = clientkeys,
                     buttons = clientbuttons } },

      ...


    { rule = { class = "Chromium" },
      properties = { border_width = 0 },
                     callback = awful.titlebar.remove }
}

And I uncommented this line to get title bars for all other windows:

awful.titlebar.add(c, { modkey = modkey })

But it seems like it doesn't work.
What am I doing wrong?

Thanks.

Last edited by mt22 (2012-06-07 07:48:13)

Offline

#2 2012-06-07 07:53:22

Vain
Member
Registered: 2008-10-19
Posts: 179
Website

Re: Awesome WM, how to remove the title bar in specific applications

Hi,

I have something like this in my rc.lua:

function titlebar_add_with_settings(c)
    awful.titlebar.add(c, { modkey = modkey, height = 16, font = "Terminus 6"})
end

awful.rules.rules = {

    -- ...

    { rule = {},
      except_any = { class = { "XTerm", "luakit", "Zathura" } },
      callback = titlebar_add_with_settings
     },

    -- ...

}

I bet you'll end up with funny race conditions if you add the titlebar and then remove it later on. So I think it's better not to add it in the first place.

Offline

#3 2012-06-07 12:39:31

mt22
Member
Registered: 2012-03-31
Posts: 20

Re: Awesome WM, how to remove the title bar in specific applications

Thanks Vain it worked!
But what do you mean when you say that if I remove the titlebar later I'll end up with race conditions? Maybe are you saying that I remove it and then the rules are executed independently of that anyway?

If so, isn't there a better way to do that?

Offline

#4 2012-06-07 15:04:35

Vain
Member
Registered: 2008-10-19
Posts: 179
Website

Re: Awesome WM, how to remove the title bar in specific applications

mt22 wrote:

But what do you mean when you say that if I remove the titlebar later I'll end up with race conditions?

Well, you added a titlebar for all windows (this is done through the "manage" signal). Plus, using "rules", you removed the titlebar for some windows. So your code tried to do something like this:

  1. A new window spawns.

  2. ["manage"] Add a titlebar.

  3. ["rules"] Remove the titlebar for some windows.

Are you sure that this always happens in this particular order? I am not. smile Maybe something like this happens instead:

  1. A new window spawns.

  2. ["rules"] Remove the titlebar for some windows (ouch! there is none!)

  3. ["manage"] Add a titlebar.

2. and 3. are mixed up here. Now, all your windows still have titlebars.

See, I really don't know if the order of execution is guaranteed. I haven't read Awesome's source code regarding this issue. So, my code avoids the whole issue because only one action is involved:

  1. A new window spawns.

  2. ["rules"] Add a titlebar iff it's not XTerm/luakit/whatever.

I think/hope this is the best way to do it. wink

Offline

#5 2012-06-07 19:48:53

mt22
Member
Registered: 2012-03-31
Posts: 20

Re: Awesome WM, how to remove the title bar in specific applications

Thanks for the clear explanation.

One last thing, I've noticed that if I add titlebars to windows (even to all windows, by only uncommenting that line as suggested in the official wiki) it happens that by switching to another workspace and switching back again to a workspace with tiling layout titlebars are not redrawn on all windows, and they only appear if I move the mouse.

I don't know if that's a bug or a strange behaviour that affect only my system, anyway to reproduce that behaviour:

1. Open at least 3 windows in a workspace with the tiling layout
2. Switch to another workspace
3. Switch back to the workspace of step 1

The titlebar of the window in the bottom right corner should disappear and reappear by moving the mouse to another window.

Do you know is that's normal? I'm using the last Awesome version (not the git one).

Offline

#6 2012-06-07 20:05:16

Vain
Member
Registered: 2008-10-19
Posts: 179
Website

Re: Awesome WM, how to remove the title bar in specific applications

I've been using titlebars for quite a while and I've never seen anything like this. Can't reproduce it either.

Do you use something like xcompmgr? Could be related. Compositing always causes problems on my hardware, so I don't use it.

If you want to investigate further, I guess it's best to check the Awesome mailing lists. smile

Offline

#7 2012-06-07 20:20:31

mt22
Member
Registered: 2012-03-31
Posts: 20

Re: Awesome WM, how to remove the title bar in specific applications

At the moment I'm not using any compositing manager. Anyway, thanks fot the advice. I think I'll ask to the Awesome community.

Offline

#8 2012-06-08 00:28:32

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: Awesome WM, how to remove the title bar in specific applications

What am I doing wrong?

Rules are interpreted before manage singnal is emitted and acted upon. You remove the titlebar at the time there was no titlebar.

I want to have title bars in all my windows while I don't want to have the title bar in Chromium

The simplest solution code wise is to apply reverse logic:
- In rules table you add the titlebar to windows you do not want to have a titlebar.
- In manage signal handler you remove titlebar from windows that already have it, and add it to all others


Proof of concept

<cut>

    { rule = { class = "Xmessage", instance = "xmessage" },
      properties = { floating = true }, callback = awful.titlebar.add  },

<cut>


client.add_signal("manage", function (c, startup)
        if     c.titlebar then awful.titlebar.remove(c)
        else awful.titlebar.add(c, {modkey = modkey}) end

<cut>

You need to install an RTFM interface.

Offline

#9 2012-06-08 07:55:26

mt22
Member
Registered: 2012-03-31
Posts: 20

Re: Awesome WM, how to remove the title bar in specific applications

Thanks anrxc, it worked too.

About that strange behaviour of the disappearing titlebar I want to correct myself, first of all it does not properly "disappear", but sometimes it is covered by other overlapping windows, and moreover I noticed it mostly happens with terminal windows (3 terminal windows should be enough to reproduce the problem), I tried urxvt and then lxterminal, with the same result.

It is like window sizes were wrongly computed, it happens when I switch workspace and then back again (to the tiled one with the 3 terminals open) and then when I move the mouse over other windows, sizes are recomputed correctly.

anrxc, do you know anything about that?

Last edited by mt22 (2012-06-08 08:21:54)

Offline

#10 2012-06-08 19:29:49

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: Awesome WM, how to remove the title bar in specific applications

Sounds like an old bug I vaguely remembe,  but it should definitely not be present in v3.4.11.

I use titlebars only on floating windows, couldn't notice this. One last thing that comes to mind you are not ignoring size hints and maybe there is some weird interaction going on with those terminals size requests and titlebars which are drawn on top of them. Try to ignore size hints.


You need to install an RTFM interface.

Offline

#11 2012-06-08 19:56:37

mt22
Member
Registered: 2012-03-31
Posts: 20

Re: Awesome WM, how to remove the title bar in specific applications

anrxc wrote:

Try to ignore size hints.

I've already tried that... same result unfortunately sad

At the moment in this debian machine I get:

~ $ awesome -v
awesome debian/3.4.11-1-1-g04eec72 (Pickapart)
 • Build: Feb  6 2012 10:04:11 for x86_64 by gcc version 4.6.2 (@zelenka)
 • D-Bus support: ✔

Offline

#12 2012-06-09 23:46:07

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: Awesome WM, how to remove the title bar in specific applications

Make a backup copy of your rc.lua and start awesome with a copy of default rc.lua with exception of enabled titlebars. Try to reproduce the problem. If you can reproduce take some screenshots and post to the bug tracker https://awesome.naquadah.org/bugs/


You need to install an RTFM interface.

Offline

#13 2018-11-15 17:04:23

snailer
Member
Registered: 2018-11-15
Posts: 4

Re: Awesome WM, how to remove the title bar in specific applications

Maybe I'm a little late, but since I experienced the same problem and found a better solution I'm gonna post it:

Adding to the

awful.rules.rules = { 

Just a titlebar boolean value on its own existence:

    -- Titlebars
    { rule_any = { type = { "dialog", "normal" } },
      properties = { titlebars_enabled = false } },

Offline

#14 2024-01-22 14:04:17

amixra
Member
Registered: 2022-01-24
Posts: 103

Re: Awesome WM, how to remove the title bar in specific applications

Vain wrote:
    { rule = {},
      except_any = { class = { "XTerm", "luakit", "Zathura" } },
      callback = titlebar_add_with_settings
     }

Sorry, for necro bumping, but this is little important for search engines indexing for folks who are finding it. Thanks BTW.


Do experiment at-least.

Offline

#15 2024-01-22 14:34:17

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,428

Re: Awesome WM, how to remove the title bar in specific applications

And apparently it can still be found perfectly fine for a necrobump anyway.

Closing this old topic.

Offline

Board footer

Powered by FluxBB