You are not logged in.

#1 2018-02-03 15:32:57

kes
Member
Registered: 2017-12-12
Posts: 35

How to Undecorate window at command line (any method will do)

Hi,

To achieve this on the command line, for an already open window, I need to get the window id then undecorate
the window. In essence "undecorate" means removing the title bar at the top of the window and any borders around it.

I get the window id using wmctrl as follows. In this case I'm interested in an mplayer window 

wmctrl -lx | grep -E "[XxVv]{2}.[MmPp]{2}layer" | grep -oE "[0-9a-z]{10}"

this outputs the window id which is
0x04200001

I then try to use wmctrl to undecorate the window as follows

wmctrl -i -r $(wmctrl -lx | grep -E "[XxVv]{2}.[MmPp]{2}layer" | grep -oE "[0-9a-z]{10}" | tail -1) -b remove,skip_taskbar

The terminal takes the command without reporting any error but does nt undecorate the window.

I don't seem to be able to get wmctrl to undecorate any window. Tried in the past as well. Lots of permutations of the command and options. Never managed it.

Ideas anyone?

I then tried using xprop as follows

xprop -id "$(wmctrl -lx | grep -E "[XxVv]{2}.[MmPp]{2}layer" | grep -oE "[0-9a-z]{10}" | tail -1)" -f _MOTIF_WM_HINTS 32c -set _MOTIF_WM_HINTS "0x2, 0x0, 0x1, 0x0, 0x0"

... and a good number of permutations of this as well.

Got some ideas from here
http://mathematicalcoffee.blogspot.co.u … mised.html

This is quite trivial within rc.xml and I can create keybindings in there that work, but I need to do this from the command line as it's going in a script


Anyone any ideas?

Here is the output for xprop for the window;

$ xprop
_NET_WM_ICON_NAME(UTF8_STRING) = "Webcam"
_NET_WM_ICON_GEOMETRY(CARDINAL) = 765, 0, 130, 24
WM_STATE(WM_STATE):
        window state: Normal
        icon window: 0x0
_NET_WM_DESKTOP(CARDINAL) = 0
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_CHANGE_DESKTOP, _NET_WM_ACTION_SHADE, _NET_WM_ACTION_CLOSE, _NET_WM_ACTION_MOVE, _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_RESIZE, _NET_WM_ACTION_FULLSCREEN, _NET_WM_ACTION_MAXIMIZE_HORZ, _NET_WM_ACTION_MAXIMIZE_VERT, _NET_WM_ACTION_ABOVE, _NET_WM_ACTION_BELOW, _OB_WM_ACTION_UNDECORATE
_KDE_NET_WM_FRAME_STRUT(CARDINAL) = 1, 1, 30, 5
_NET_FRAME_EXTENTS(CARDINAL) = 1, 1, 30, 5
_NET_WM_STATE(ATOM) = _NET_WM_STATE_ABOVE
_NET_WM_ICON(CARDINAL) =     Icon (48 x 48):

_OB_APP_TYPE(UTF8_STRING) = "normal"
_OB_APP_TITLE(UTF8_STRING) = "MPlayer"
_OB_APP_GROUP_CLASS(UTF8_STRING) = 
_OB_APP_GROUP_NAME(UTF8_STRING) = 
_OB_APP_CLASS(UTF8_STRING) = "MPlayer"
_OB_APP_NAME(UTF8_STRING) = "xv"
_OB_APP_ROLE(UTF8_STRING) = 
_NET_WM_VISIBLE_ICON_NAME(UTF8_STRING) = "Webcam"
_NET_WM_VISIBLE_NAME(UTF8_STRING) = "Webcam"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
        program specified location: 41, 360
        program specified size: 300 by 168
        program specified minimum size: 4 by 4
        program specified minimum aspect ratio: 300/168
        program specified maximum aspect ratio: 300/168
        program specified base size: 0 by 0
        window gravity: Static
_NET_WM_PID(CARDINAL) = 23658
WM_CLASS(STRING) = "xv", "MPlayer"
_NET_WM_NAME(UTF8_STRING) = "Webcam"
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW

Last edited by kes (2018-02-03 15:40:02)

Offline

#2 2018-02-03 19:56:43

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,741

Re: How to Undecorate window at command line (any method will do)

Perhaps explain what you are really trying to do? Another tool that might help to achieve such magic is xdotool.

Last edited by brontosaurusrex (2018-02-03 19:58:30)

Online

#3 2018-02-04 10:15:44

vasa1
Member
Registered: 2015-09-29
Posts: 204

Re: How to Undecorate window at command line (any method will do)


Using the Openbox (3.5.2) session of Lubuntu 14.04 LTS but very interested in BL :)

Offline

#4 2018-02-04 13:10:01

kes
Member
Registered: 2017-12-12
Posts: 35

Re: How to Undecorate window at command line (any method will do)

Thanks a lot for the replies guys.

brontosaurusrex: I'm using mplayer for my webcam, and screen casting with an inset on my screen showing the webcam inset of myself talking through different problems. The mplayer taskbar was redundant and wasting valuable screen space, so it had to go.

I tried xdotool. Didn't work for me either. 

I had difficulty finding anything.

Vasa: Thanks for the link. In essence I solved this problem by compiling a small C program I found as detailed here
https://unix.stackexchange.com/a/421805/46470

Thanks again

Last edited by kes (2018-02-04 13:14:33)

Offline

#5 2018-02-04 13:24:58

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,741

Re: How to Undecorate window at command line (any method will do)

Mplayer -no border ?
Or use mpv.

Online

#6 2018-02-06 18:37:23

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: How to Undecorate window at command line (any method will do)

kes wrote:

I then try to use wmctrl to undecorate the window as follows

-b remove,skip_taskbar

this does not do what you think.
it means you won't see an icon of the window in question on the taskbar, tint2 in bunsenlab's case.
the opposite actually, it would remove the skip_taskbar property.
i'm not sure if openbox supports undecorating on the fly programmatically.
could you give a distinct name/class to the webcam window, then add a rule to rc.xml under <applications>?

Last edited by ohnonot (2018-02-06 18:38:53)

Offline

#7 2018-02-07 12:07:30

kes
Member
Registered: 2017-12-12
Posts: 35

Re: How to Undecorate window at command line (any method will do)

Hi brontosaurusrex,

brontosaurusrex wrote:

Mplayer -no border ?
Or use mpv.

I need to undecorate almost every window on the screen to maximise screen space while webcasting, so I needed something generic that would undecorate anything.

I had a look at mpv last night. Going to have a look again later

Thanks

Offline

#8 2018-02-07 12:17:58

kes
Member
Registered: 2017-12-12
Posts: 35

Re: How to Undecorate window at command line (any method will do)

Hi ohnonot,

ohnonot wrote:
kes wrote:

I then try to use wmctrl to undecorate the window as follows

-b remove,skip_taskbar

this does not do what you think.
it means you won't see an icon of the window in question on the taskbar, tint2 in bunsenlab's case.
the opposite actually, it would remove the skip_taskbar property.
i'm not sure if openbox supports undecorating on the fly programmatically.
could you give a distinct name/class to the webcam window, then add a rule to rc.xml under <applications>?

"could you give a distinct name/class to the webcam window, then add a rule to rc.xml under <applications>?"


I have defined a class under <applications> for an application window in rc.xml before, in a different circumstance, but I can't find the snippet anywhere and I can't remember how I did it.
In any case I wanted to do this without a mod in rc.xml.
May be that is the way forward. Going to ponder it. Thanks

Last edited by kes (2018-02-07 12:18:41)

Offline

Board footer

Powered by FluxBB