Ab Terminals in einer bestimmten Art und Weise?
-
27-09-2019 - |
Frage
Ich versuche, ein Skript zu schreiben, um mich auf dem Bildschirm an einer bestimmten Stelle eine Reihe von Terminals mit einer bestimmten Größe beginnen zu lassen (zum Beispiel vier Terminals verteilt über die LCD-Display in einem Gittermodell jeden aktiv). Wenn bereits ein Tool, das dies tun kann, das wäre auch toll sein ... Irgendwelche Vorschläge?
Lösung
Ich bin sicher, dass es bessere Antworten, aber eine Sache, finde ich tat nützlich war:
gnome-terminal --geometry=130x25+20+525
So auf meinem großen Monitor, folgende gibt mir zwei schöne Terminals:
#!/bin/sh
gnome-terminal --geometry=150x125+20+25
gnome-terminal --geometry=150x125+1020+25
Und die folgende ist die Erklärung von dem Manpage zum schnellen Nachschlagen:
-geometry WIDTHxHEIGHT+XOFF+YOFF
(where WIDTH, HEIGHT, XOFF,
and YOFF are numbers) for specifying a preferred size and location for
this application's main window.
The WIDTH and HEIGHT parts of the geometry specification are usually
measured in either pixels or characters, depending on the application.
The XOFF and YOFF parts are measured in pixels and are used to specify
the distance of the window from the left or right and top and bottom
edges of the screen, respectively. Both types of offsets are measured
from the indicated edge of the screen to the corresponding edge of the
window. The X offset may be specified in the following ways:
+XOFF The left edge of the window is to be placed XOFF pixels in from
the left edge of the screen (i.e., the X coordinate of the win-
dow's origin will be XOFF). XOFF may be negative, in which
case the window's left edge will be off the screen.
-XOFF The right edge of the window is to be placed XOFF pixels in
from the right edge of the screen. XOFF may be negative, in
which case the window's right edge will be off the screen.
The Y offset has similar meanings:
+YOFF The top edge of the window is to be YOFF pixels below the top
edge of the screen (i.e., the Y coordinate of the window's ori-
gin will be YOFF). YOFF may be negative, in which case the
window's top edge will be off the screen.
-YOFF The bottom edge of the window is to be YOFF pixels above the
bottom edge of the screen. YOFF may be negative, in which case
the window's bottom edge will be off the screen.
Dieser Ansatz ist sehr einfach und mit einem Befehl wie folgt aus:
gnome-terminal -x sh -c "ls|less"
Zusätzlich zu den oben genannten Befehle kann man noch mehr Phantasie Dinge tun :) Zum Beispiel, können Sie es selbst machen starten in ein bestimmtes Verzeichnis (sehr nützlich, wenn Sie Quellcode in einem Fenster gerade bearbeiten und Debuggen der anderen mit wie ich bin).
Andere Tipps
Terminitor ist ein Projekt, dass Adressen aus: https://github.com/achiu/terminitor
Leider ist es nicht gnome-terminal Unterstützung noch hat (nur OS X und Konsole).