How can I minimize the Terminal window using a command? For example: I use the clear
command to clear the terminal output, which command can I have to use to minimize the terminal window?
2 Answers
You could use this command:
xdotool windowminimize $(xdotool getactivewindow)
You can change xdotool getactivewindow
with a specific window that you would like to minimize.
xdotool
wouldn't be installed on Ubuntu by default.So run the below command to install xdotool
package.
sudo apt-get install xdotool
-
2
-
-
You can actually chain the 2 xdotool commands in one (instead of running xdotool twice). Ref: ubuntuforums.org/showthread.php?t=2214221 (tried on Ubuntu 16.04) Command: xdotool getactivewindow windowminimize– ChampOct 9, 2018 at 18:04
If you are using the byobu terminal, you can press F6 to detach from the current session. This will have the effect of closing the window, but continuing to run byobu and all its subprograms in the background. To reattach to that session, just run byobu again as you normally would.
bg %0
where 0 is the pid of the Terminal Window would send it to the background, not quite the same, but similar :)