Xfce Forum

Sub domains
 

You are not logged in.

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

orschiro
Member
Registered: 2017-11-30
Posts: 65

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
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

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.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

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

orschiro
Member
Registered: 2017-11-30
Posts: 65

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: 15

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
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Hide window decoration of a specific window?

Yes. I  believe it is python-gtk2.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

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

Misko_2083
Member
Registered: 2015-10-13
Posts: 211
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.


Do you want to exit the Circus?
https://www.youtube.com/watch?v=ZJwQicZHp_c

Offline

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

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

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
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

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)


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

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

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

Re: Hide window decoration of a specific window?

Works like a charm, thanks!

Offline

#10 2021-02-19 11:09:44

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

Re: Hide window decoration of a specific window?

Actually it doesn't work on Gnome applications (e.g. gthumb). Is there a solution to that?

Offline

#11 2021-02-19 11:38:52

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Hide window decoration of a specific window?

ChameleonScales wrote:

Actually it doesn't work on Gnome applications (e.g. gthumb). Is there a solution to that?

Because it uses CSD - the only way to manipulate those windows is for the application to support it. The above solution works only with SSD windows.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#12 2022-08-07 18:14:32

ssq
Member
Registered: 2022-08-07
Posts: 3

Re: Hide window decoration of a specific window?

An easy and customizable solution if you can write just a little code, using devilspie2.

Instructions here: https://unix.stackexchange.com/question … ram#712774

Tested on Debian 11 XFCE.

Hope this helps smile

Last edited by ssq (2022-08-07 20:59:15)

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.016 seconds, 7 queries executed - Memory usage: 561.95 KiB (Peak: 578.79 KiB) ]