Xfce Forum

Sub domains
 

You are not logged in.

#1 2019-03-22 14:36:44

orschiro
Member
Registered: 2017-11-30
Posts: 40
Website

Hide window decoration of a specific window?

Hi all,

I would like to remove/hide the window decoration bar of the Workrave window below.

Any ideas how I can achieve this?

Thank you! ??

zXmS5eS.png

Offline

#2 2019-03-22 17:43:46

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 6,979

Re: Hide window decoration of a specific window?

Manual way:

Save the following contents to a file and make it executable:

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

...and assign it to a keyboard shortcut. With that window focused, press the hotkey combination.

*Note: there might be something off with that script. I need to press the hotkey twice for every new window (then once afterwards). The script might need to be tweaked but it works.

Automated method:
You can use devilspie. To do so, run devilspie in debug mode:

devilspie -d

...and post back the snippet that is displayed when that window is opened. You can then write a .ds file that will automatically undecorate it. This requires that devilspie is running as a daemon.

Offline

#3 2019-03-22 17:56:54

orschiro
Member
Registered: 2017-11-30
Posts: 40
Website

Re: Hide window decoration of a specific window?

Thanks ToZ! ⭐

I went with the following solution:

[orschiro@x230 ~]$ cat .config/devilspie2/workrave.lua 
if (get_window_name() == "Workrave") then
	undecorate_window();
end

Last edited by orschiro (2019-03-22 18:03:02)

Offline

#4 2019-12-31 09:10:06

ChameleonScales
Member
Registered: 2019-11-21
Posts: 11

Re: Hide window decoration of a specific window?

@Toz I liked your python solution but it doesn't seem to work out of the box since Debian 10.
I get:

ImportError: No module named gtk.gdk

Am I missing a package?

Last edited by ChameleonScales (2019-12-31 09:10:31)

Offline

#5 2019-12-31 11:24:01

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 6,979

Re: Hide window decoration of a specific window?

Yes. I  believe it is python-gtk2.

Offline

#6 2020-01-01 01:28:33

Misko_2083
Member
Registered: 2015-10-13
Posts: 146
Website

Re: Hide window decoration of a specific window?

This app works:
https://gist.github.com/muktupavels/d03 … 4c87df975d
Just need to pass the Xwindow ID to it.

Offline

#7 2020-09-12 19:04:26

ChameleonScales
Member
Registered: 2019-11-21
Posts: 11

Re: Hide window decoration of a specific window?

Looks like python-gtk2 is gone from Ubuntu 20. Any chance you could update your python script to GTK3 (and preferably python3)?

Offline

#8 2020-09-12 19:46:02

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 6,979

Re: Hide window decoration of a specific window?

ChameleonScales wrote:

Looks like python-gtk2 is gone from Ubuntu 20. Any chance you could update your python script to GTK3 (and preferably python3)?

Have a read through this post. It shows you how to compile a small c program to do the same.

Once compiled, make sure xdotool is installed, then bind the following to a shortcut key:

bash -c "/path/to/toggle-decorations $(xdotool getactivewindow)"

Edit: changed shortcut command to work.

Last edited by ToZ (2020-09-12 19:50:28)

Offline

#9 2020-09-16 07:29:10

ChameleonScales
Member
Registered: 2019-11-21
Posts: 11

Re: Hide window decoration of a specific window?

Works like a charm, thanks!

Offline

Board footer

Powered by FluxBB