4

I am running Ubuntu 16.04. I want to undecorate (remove borders and title bar) of a window. I found an old posted scripts on the net claimed to be working but it doesn't work now.

To undecorate:

xprop -f _MOTIF_WM_HINTS 32c -set _MOTIF_WM_HINTS "0x2, 0x0, 0x0, 0x0, 0x0"

To redecorate:

xprop -f _MOTIF_WM_HINTS 32c -set _MOTIF_WM_HINTS "0x2, 0x0, 0x1, 0x0, 0x0"

Though this python script works

#! /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()

How can I toggle window decoration from terminal without python?

kenn
  • 5,232

1 Answers1

5

This will not work in compiz! Compiz expects that _MOTIF_WM_HINTS property type is _MOTIF_WM_HINTS, but xprop command sets it to CARDINAL. If you use xprop | grep _MOTIF_WM_HINTS you will see this:

_MOTIF_WM_HINTS(CARDINAL) = 2, 0, 0, 0, 0

It should be like this:

_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 2, 0, 0, 0, 0

Your python script works, because GTK+ properly sets this property. :)

DK Bose
  • 44,553
muktupavels
  • 1,374