LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Minimize the current window with WMCTRL ? (https://www.linuxquestions.org/questions/linux-desktop-74/minimize-the-current-window-with-wmctrl-4175600173/)

Xeratul 02-20-2017 02:16 AM

Minimize the current window with WMCTRL ?
 
Hello,

xdotool can do everything but it is not installed everywhere at schools.
wmctrl is a standard that is available everywhere.

How can one minimize the current Window with wmctrl ?

To maximize, easy:
Code:

"  wmctrl -r :ACTIVE: -b toggle,maximized_vert,maximized_horz  "

But minimize?

Thank you in advance

ondoho 02-21-2017 03:49 PM

Quote:

Originally Posted by man wmctrl
ACTIONS

-b ( add | remove | toggle),prop1 [,prop2 ]
Add, remove, or toggle up to two window properties simultaneously. The window that
is being modified must be identified with a -r action. The property change is
achived by using the EWMH _NET_WM_STATE request. The supported property names (for
prop1 and prop2) are modal, sticky, maximized_vert, maximized_horz, shaded,
skip_taskbar, skip_pager, hidden, fullscreen, above and below. Two properties are
supported to allow operations like maximizing a window to full screen mode. Note
that this action is made up of exactly two shell command line arguments.

???

Xeratul 02-24-2017 01:06 AM

Quote:

Originally Posted by ondoho (Post 5674277)
???

I meant to minimize ....

it is not easy, believe me, since wmctrl to get the current win for minimize is not made.. by default.

rholt 02-24-2017 10:51 AM

I tried using hidden but it didn't work nor complain.

Xeratul 02-24-2017 03:40 PM

Quote:

Originally Posted by rholt (Post 5675457)
I tried using hidden but it didn't work nor complain.

I think that it is possibel with this first idea ...


Code:

WMCX=$( wmctrl -l )
CURRENTAPP=` xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2 | awk ' { gsub("0x" , "0x0" ); print $0  } '`
CURRENTDESKTOP=` echo "$WMCX" | grep  "$CURRENTAPP" | awk ' {  print $2 } ' `


syg00 02-24-2017 04:41 PM

Keep in mind that wayland is approaching - for some is already the default. wmctrl is yet another that doesn't work.

Xeratul 02-25-2017 01:53 AM

Quote:

Originally Posted by syg00 (Post 5675607)
Keep in mind that wayland is approaching - for some is already the default. wmctrl is yet another that doesn't work.


it is really bad that nothing never works in LINUX.

ondoho 02-25-2017 12:11 PM

it seems indeed that wmctrl cannot do it.
here'a an interesting article:
https://askubuntu.com/questions/4876...e-command-line

however:
Quote:

Originally Posted by Xeratul (Post 5673363)
xdotool can do everything but it is not installed everywhere at schools.
wmctrl is a standard that is available everywhere.

i'm not sure i agree that wmctrl is "the standard everywhere". i would rather expect the X utilites to be that.

i was always under the impression that wmctrl is a very handy, but increasingly outdated program, but if you're a bit more proficient you can achieve the same (and more) with xwininfo, xprop and such.


All times are GMT -5. The time now is 08:29 PM.