Skip to content

Instantly share code, notes, and snippets.

@lirenlin
Last active April 21, 2024 17:27
Show Gist options
  • Star 68 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save lirenlin/9892945 to your computer and use it in GitHub Desktop.
Save lirenlin/9892945 to your computer and use it in GitHub Desktop.
i3 wm, hide window title bar
@AVAtarMod
Copy link

That works on i3 version 4.18 (2020-02-18)!

@Yugo19
Copy link

Yugo19 commented Sep 3, 2021

Thank man!!!

@rklak
Copy link

rklak commented Jan 4, 2022

2022 still works :)

@mutoyoru
Copy link

Thank you!

@SpookNyan
Copy link

Thank You! <3

Copy link

ghost commented Feb 16, 2022

Thanks my homie

@KarimullinArthur
Copy link

Thanks! ^-^

@Jay-flow
Copy link

Thx 👍

@kuzen
Copy link

kuzen commented May 27, 2022

Thx!

@Blayung
Copy link

Blayung commented Jun 3, 2022

Is there any way of deleting window titles in stacked and tabbed mode?

@lovegap
Copy link

lovegap commented Jun 30, 2022

very thanks!

@thunpin
Copy link

thunpin commented Jul 20, 2022

Hey, I could notice that only with for_window [class="^.*"] border pixel 1 apps like gedit are getting boards.

@Antiz96
Copy link

Antiz96 commented Sep 23, 2022

Since the v4.21 release, the following snippet does not work anymore:

default_border pixel 1
default_floating_border pixel 1

Switching back to the following snippet worked (even tho it has been categorized as deprecated):

for_window [class="^.*"] border pixel 1

In anticipation of a future update that make another change, I actually put both solutions in my config file, like so:

#Hide window title bar
default_border pixel 1
default_floating_border pixel 1
for_window [class="^.*"] border pixel 1

Hope it helps 😄

@stuvet
Copy link

stuvet commented Sep 23, 2022

Thanks @Antiz96 I came here for this 10 sec after you posted it!

@Antiz96
Copy link

Antiz96 commented Sep 23, 2022

@stuvet I'm glad I could help :)

@sahilrajput03
Copy link

Amazing I just came here to see it coz suddenly my title bar started to show out of nowhere.!

@voylin
Copy link

voylin commented Sep 25, 2022

Since the v4.21 release, the following snippet does not work anymore:

default_border pixel 1
default_floating_border pixel 1

Switching back to the following snippet worked (even tho it has been categorized as deprecated):

for_window [class="^.*"] border pixel 1

In anticipation of a future update that make another change, I actually put both solutions in my config file, like so:

#Hide window title bar
default_border pixel 1
default_floating_border pixel 1
for_window [class="^.*"] border pixel 1

Hope it helps smile

Solved this problem for me ^^
Thanks!

@mclang
Copy link

mclang commented Sep 26, 2022

Search is wonderful things - thanks!

@gregdan3
Copy link

This was exactly the problem I had. Weird change! Thanks for the insight.

@panzhc
Copy link

panzhc commented Sep 29, 2022

Thx!

@sukulent
Copy link

sukulent commented Oct 4, 2022

Also used only

default_border pixel 1
default_floating_border pixel 1

few apps worked, few didn't
added the
for_window [class="^.*"] border pixel 1
now everything works as expected except applications running in wine.
anyone any idea?

@orhun
Copy link

orhun commented Oct 5, 2022

Great stuff, thanks a lot!

@argoncloud
Copy link

Since the v4.21 release, the following snippet does not work anymore:

default_border pixel 1
default_floating_border pixel 1

Switching back to the following snippet worked (even tho it has been categorized as deprecated):

for_window [class="^.*"] border pixel 1

In anticipation of a future update that make another change, I actually put both solutions in my config file, like so:

#Hide window title bar
default_border pixel 1
default_floating_border pixel 1
for_window [class="^.*"] border pixel 1

Hope it helps smile

Thanks a lot for the fix, @Antiz96 . My latest Fedora 35 update picked up 4.21 and I started seeing borders as well... this got me back to normal.

@alalfakawma
Copy link

Thanks!

@mowamed
Copy link

mowamed commented Oct 20, 2022

Thanks, works great

@moghwan
Copy link

moghwan commented Oct 23, 2022

Since the v4.21 release, the following snippet does not work anymore:

default_border pixel 1
default_floating_border pixel 1

Switching back to the following snippet worked (even tho it has been categorized as deprecated):

for_window [class="^.*"] border pixel 1

In anticipation of a future update that make another change, I actually put both solutions in my config file, like so:

#Hide window title bar
default_border pixel 1
default_floating_border pixel 1
for_window [class="^.*"] border pixel 1

Hope it helps smile

Thanks a lot for the fix, @Antiz96 . My latest Fedora 35 update picked up 4.21 and I started seeing borders as well... this got me back to normal.

worked like a charm after a recent upgrade, thank you all!

@Linux-NDOB
Copy link

#Hide window title bar
default_border pixel 1
default_floating_border pixel 1
for_window [class="^.*"] border pixel 1

Still working, thank you man.

@Dpbm
Copy link

Dpbm commented Dec 2, 2022

thanks man, now my i3 looks amazing :)

@qordaz
Copy link

qordaz commented Feb 24, 2023

Is there any way of deleting window titles in stacked and tabbed mode?

Not directly. It is possible in a fairly easy manner though.
My solution was to set the font to 0 in ~/.config/i3/config . Then just toggle font on and off with this script (since sometimes I do want the titlebar to be there). You need of course to match the font line with your own:

#!/bin/bash

grep "font pango:Terminus (TTF) Medium" ~/.config/i3/config |grep 0

if [ $? -eq 0 ]; then
  sed -i 's/font pango:Terminus (TTF) Medium 0/font pango:Terminus (TTF) Medium 9/' ~/.config/i3/config
else
  sed -i 's/font pango:Terminus (TTF) Medium 9/font pango:Terminus (TTF) Medium 0/' ~/.config/i3/config
fi

i3-msg reload

This leaves a 4px border (I read in another post which Airblader answered) This can easily be removed from the source code. A super simple patch which I just put inside my patches folder in Gentoo:
/etc/portage/patches/x11-wm/i3-gaps/remove-win-decor.patch :

--- a/src/render.c      2023-02-24 05:52:44.727717499 +0100
+++ b/src/render.c      2023-02-24 05:53:13.134384539 +0100
@@ -27,7 +27,7 @@
  * Returns the height for the decorations
  */
 int render_deco_height(void) {
-    int deco_height = config.font.height + 4;
+    int deco_height = config.font.height;
     if (config.font.height & 0x01)
         ++deco_height;
     return deco_height;

@thoughtsunificator
Copy link

thoughtsunificator commented Feb 20, 2024

Thanks @qordaz

In case some of you might want to remove the title bar entirely :

int render_deco_height(void) {
     return 0;
}

That's what I did, not sure if that's how it supposed to be done..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment