Minimizing a window might free a little memory, but it depends on the application, and it won't amount to much. In any case, minimizing won't make more difference than any other form of hiding.
Even if an application's window is minimized, it's still running. The application isn't going to need to keep less data in memory just because one of its windows is minimized.
An application is notified whenever one of its windows is minimized or restored. It's also notified whenever part of its window becomes visible or hidden. It is possible, but unlikely, that the application would react differently to various reasons its window may be hidden:
- It can be minimized, meaning the window is not shown and an icon is shown in its place.
- It can be hidden behind other windows (including the full-screen window of a screensaver).
- It can be displayed on a different desktop, workspace, viewport, or whatever your window manager calls these.
- It can be hidden in some other manner, for example “shaded” (meaning only a title bar is shown), or simply unmapped (meaning the window manager has decided for whatever reason that the window shouldn't be displayed).
If an application's window is completely hidden, then the application doesn't need to refresh the window contents. If it needs to allocate memory to refresh that content, it won't be doing it while the window is hidden. Also, if a window is hidden (for any reason), the application might free a little memory inside the X server.
What makes more of a difference in practice is that if a window isn't being displayed, then the application doesn't make computations to redraw the contents, and therefore the data needed to draw the contents can be swapped out. If RAM is tight and there's a window you aren't going to iteract with for a while, it's better if the window is not mapped. Again, the reason why the window is not mapped (hidden behind others, minimized, shaded, …) is unimportant.
Yes, you can do this with xpra. From their homepage:
"To start an application (a simple xterm in this example) on a remote system and display it your local machine, simply run:
xpra start ssh:SERVERHOSTNAME:100 --start-child=xterm
This is similar to ssh -X, except it is faster and you can disconnect and re-connect to the session as many times as you like. (obviously xpra must be installed on your server host)
To re-connect or to connect to this session from another machine, use the attach command (you can also use the xpra_launcher GUI):
xpra attach ssh:serverhostname:100
Best Answer
xdotool
needs to know the window ID for all its actions. You correctly usedgetactivewindow
to obtain the window for thewindowminimize
command, but you also need to do it for setting its name. So putbefore the minimize line.
Then you can use
search
to find it for activating later.See the manpage sections Window stack and Command chaining for an explanation of how this all works.
The whole script: