8

I have developed a program with glut library and want to remove its title bar.

Since its impossible to remove the title bar from glut library I have to use an external tool to remove its title bar.

Regarding the fact that it is possible to manipulate other windows decoration in Windows operating system I hope to find a similar remedy for this obstacle.

Do you have any Idea about how to remove specific window title bar with a script or a simple X11 application ?

  • Window managers can also manipulate the window decorations in certain degree. With IceWM you can put a line in ~/.icewm/winoptions yourWindow.dTitleBar: 0. – manatwork Dec 2 '13 at 12:40
  • A window's title bar is drawn and managed by the window manager, not by applications. Window managers decide things like whether to display a title bar based on ICCCM hints or their modern derivatives. I don't think you can control this in a way that's independent of both the application and the window manager. – Gilles 'SO- stop being evil' Dec 2 '13 at 23:32
9

Wmctrl

This is kind of related but you could change the text in the title bar of this mystery application using the command wmctrl.

Example

Say I ran the application gvim. It shows up as follows when I list the open windows.

$  wmctrl -l
0x04402eed -1 grinchy N/A
0x00c00003 -1 grinchy Bottom Expanded Edge Panel
0x00c00028 -1 grinchy Top Expanded Edge Panel
0x0120001e  0 grinchy x-nautilus-desktop
0x02a00004  0 grinchy saml@grinchy:~
0x06800003  0 grinchy [No Name] - GVIM

So the gvim window has the title "[No Name] - GVIM", we can change its name like so, again using wmctrl:

$ wmctrl -r "[No Name] - GVIM" -N "new name"

Running the -l switch again we can see the new name:

$ wmctrl -l
0x04402eed -1 grinchy N/A
0x00c00003 -1 grinchy Bottom Expanded Edge Panel
0x00c00028 -1 grinchy Top Expanded Edge Panel
0x0120001e  0 grinchy x-nautilus-desktop
0x02a00004  0 grinchy saml@grinchy:~
0x06800003  0 grinchy new name

All decorations

There is this method discussed in this AskUbuntu Q&A titled: Can I hide the title bar of MPlayer in gnome?.

There was this gist of Python - window-toggle-decorations.py that looked to do kind of what you wanted. It might be modifiable to suit your needs.

window-toggle-decorations.py

#! /usr/bin/python2
import gtk.gdk
w = gtk.gdk.window_foreign_new( gtk.gdk.get_default_root_window().property_get("_NET_ACTIVE_WINDOW")[2][0] )
w.set_decorations( (w.get_decorations()+1)%2 ) # toggle between 0 and 1
gtk.gdk.window_process_all_updates()
gtk.gdk.flush()

# now bind this to super-r or something 
  • Wow ! it worked ! It should be run in this way : python2 ./toggle.py. I haven't seen something like that and at least now I have a clue to the answer. Thank you Smart Looking Man(slm). – Sponge Comrade Dec 3 '13 at 5:27
  • I tested it with a system("python2 ./toggle.py") call and it worked too, however I'm sure its code is convertible to C++. – Sponge Comrade Dec 3 '13 at 6:09
  • Strange thing is that I have to call it two times to effect!!! system("python2 ./toggle.py"); system("python2 ./toggle.py"); it is ridiculous ! but it works for me and it is enough :D – Sponge Comrade Dec 3 '13 at 6:14
3

There is a simple C program that works developed by Muktupavels. https://gist.github.com/muktupavels.

I use it and it works very well. It's here

https://gist.github.com/muktupavels/d03bb14ea6042b779df89b4c87df975d

It lets you toggle the title bar on and off for any given application.

To use it, simply make sure you have the libx11-dev library installed

sudo apt-get install -y libx11-dev

then compile the code using this command

gcc toggle-decorations.c -Wall -o toggle-decorations `pkg-config --cflags --libs x11`

and run it with this command

./toggle-decorations $(wmctrl -lx | grep -E "name_of_your_application_here" | grep -oE "[0-9a-z]{10}")

where $(...) captures the --id of your application using wmctrl.

I did not do this great work and take no credit for it.

It was done by muktupavels.

  • the only thing that worked on Unity/compiz thx! – Aquarius Power Jan 11 at 18:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.