This works..
xdotool search "Mozilla Firefox" windowminimize
but this does not minimize my Terminal.
xdotool search "Terminal" windowminimize
Defaulting to search window name, class, and classname
wmctrl -l
0x01400003 -1 andy-To-be-filled-by-O-E-M Top Panel
0x01400017 -1 andy-To-be-filled-by-O-E-M Bottom Panel
0x01400025 -1 andy-To-be-filled-by-O-E-M Top Panel
0x01600006 -1 andy-To-be-filled-by-O-E-M Desktop
0x02800007 0 andy-To-be-filled-by-O-E-M Downloads - Thunar
0x0360003e 0 andy-To-be-filled-by-O-E-M How to minimize an application window from command line - Unix & Linux Stack Exchange — Mozilla Firefox
0x03800006 0 andy-To-be-filled-by-O-E-M Terminal
0x03c00007 0 andy-To-be-filled-by-O-E-M *untitled - Geany
Why isn't my Terminal being minimized?
Yeah, it doesn't work for me either. I wonder if it has anything to do with what is mentioned here in this related answer:
In any case, using
xdotool
to press the following keyboard shortcut works on regular Ubuntu (tested on Ubuntu Unity):Some research shows that XFCE uses alt+f9 to minimize and alt+f10 to maximize so if the previous command doesn't work, then try this instead:
I realize this is kind of a hacky workaround but it seems to work, at least.
Lastly, if you ever have trouble with or need to know a key name, this list of xdotool key codes can be used to fall back on.