Using wmctrl to close windows

Is it possible to close a window with wmctrl , which runs on Wine on Ubuntu?

For context:

 $ wmctrl -m Name: compiz Class: N/A PID: N/A Window manager "showing the desktop" mode: OFF 

also:

 $ wmctrl -l 0x0240a3be -1 mjol N/A 0x02000003 0 mjol Top Expanded Edge Panel 0x0200004c 0 mjol Bottom Expanded Edge Panel 0x01e00024 0 mjol x-nautilus-desktop 0x04800253 0 mjol using wmctrl to close windows - Qaru - Google Chrome 0x03c0c8c3 0 mjol Terminal 0x03c53f25 0 mjol Terminal 0x04400001 0 mjol Untitled - SketchUp 0x04400003 0 mjol Instructor 0x04400009 0 mjol SketchUp 

The window I want to close is the last one:

 0x04400009 0 mjol SketchUp 

I tried the following:

 $ wmctrl -c "SketchUp" $ wmctrl -c 0x04400009 $ wmctrl -i 0x04400009 $ wmctrl -c -i 0x04400009 

But nothing works.

+4
source share
2 answers

Maybe a little late, but first seen. Reading the information for wmctrl, he says that the correct syntax is the “parameters” before actions , and -i is an option, -c action. Try wmctrl -i -c 0x04400009

+6
source

According to the man page, you should select the window first with a selection option, for example -r and -a , for example:

 $ wmctrl -l 0x01800006 0 hostname Terminal - byobu $ wmctrl -a Terminal 

It really selects (and rises + focus from -a ) the terminal window.

Then you can use the resize / move option, e.g. -e gravity,X,Y,width,height

As for your question, I just tested this:

 $ wmctrl -l 0x01800006 0 machine_hostname - byobu 0x06800002 0 moe Microsoft Excel - Classeur1 

And Excel (obviously running in Wine) closed gracefully when I typed

 $ wmctrl -c Microsoft 

More info here .

0
source

Source: https://habr.com/ru/post/1343969/


All Articles