You can put the script below under a key combination. If you press the key combination, the terminal window(s) will disappear (completely). Press it again, they will pop up again exactly in the state as you had it.
Only thing you need to to (once) is to add the identifying string in your terminal's window name (the terminal window has the same name in most cases)
To use it
sudo apt-get install xdotool
sudo apt-get install wmctrl
- Copy the script into an empty file, save it as
- In the head section, set the identifying string of the terminal window's name
Run it under a key combination:
home = os.environ["HOME"]
hidden_windowid = home+"/.window_id.txt"
get = lambda cmd: subprocess.check_output(cmd).decode("utf-8")
# --- set the identifying string in the terminal window's name below (you mentioned "Terminal"
window_idstring = "Special_window"
w_id = [l.split() for l in get(["wmctrl", "-l"]).splitlines() if window_idstring in l]
if len(w_id) !=0:
for w in w_id:
execute(["xdotool", "windowunmap", w])
with open(hidden_windowid, "a") as out:
with open(hidden_windowid) as read:
for w in [w.strip() for w in read.readlines()]:
execute(["xdotool", "windowmap", w])
with open(hidden_windowid, "wt") as clear: