
ターミナルを開いて、それを 9 つの部分 (3x3) に分割し、いくつかの bash スクリプトを実行したいと思います。ただし、ターミナルの各部分には異なるスクリプトが必要です。
これは perl、python、あるいは bash を使用して実行できますか?
キーボードショートカットを使用せずに、これらの小さなターミナルを切り替えるにはどうすればよいでしょうか?
ちなみに、私は を使用していますterminator
。また、このような機能を有効にする他のターミナル エミュレーターがある場合は、どれですか?
答え1
自分を盗作する、希望する設定でプロファイルを設定できます(手順はここ):
実行して
terminator
、必要なレイアウトを設定します。Ctrl+ Shift+ を使用するEとウィンドウを垂直に分割でき、Ctrl+ Shift+ O(O はゼロではなく、oodles の O です) を使用すると水平に分割できます。この例では、6 つのペインを持つレイアウトを作成しました。ウィンドウを右クリックし
terminator
て選択環境設定一度環境設定ウィンドウが開いている場合は、レイアウトクリック追加:これにより、レイアウト新しいレイアウトのリスト:
レイアウトで作成した各ターミナルを見つけてクリックします。次に、右側に、起動時にターミナルで実行するコマンドを入力します。
重要:コマンドの後に が続くことに注意してください
; bash
。これを行わないと、ターミナルは指定したコマンドを実行して終了するため、アクセスできなくなります。ターミナルを使用するには、各コマンドの後にシェルを起動する必要があります。すべてのコマンドを設定したら、クリックします近いそして終了します
terminator
。terminator
設定ファイルを開き~/.config/terminator/config
、レイアウトの下のデフォルト設定のセクションを削除します。次に、作成したレイアウトの名前を default に変更します。次のようになります。[global_config] [keybindings] [profiles] [[default]] [layouts] [[default]] [[[child0]]] position = 446:100 type = Window order = 0 parent = "" size = 885, 550 [[[child1]]] position = 444 type = HPaned order = 0 parent = child0 [[[child2]]] position = 275 type = VPaned order = 0 parent = child1 [[[child5]]] position = 219 type = HPaned order = 1 parent = child1 [[[child6]]] position = 275 type = VPaned order = 0 parent = child5 [[[child9]]] position = 275 type = VPaned order = 1 parent = child5 [[[terminal11]]] profile = default command = 'df -h; bash' type = Terminal order = 1 parent = child9 [[[terminal10]]] profile = default command = 'export foo="bar" && cd /var/www/; bash' type = Terminal order = 0 parent = child9 [[[terminal3]]] profile = default command = 'ssh -Yp 24222 [email protected]' type = Terminal order = 0 parent = child2 [[[terminal4]]] profile = default command = 'top; bash' type = Terminal order = 1 parent = child2 [[[terminal7]]] profile = default command = 'cd /etc; bash' type = Terminal order = 0 parent = child6 [[[terminal8]]] profile = default command = 'cd ~/dev; bash' type = Terminal order = 1 parent = child6 [plugins]
最終結果として、実行するとterminator
6 つのペインが開き、各ペインで指定したコマンドが実行されたか、実行中になります。
また、必要な数の異なるプロファイルを設定し、-p
プロファイル名を指定するスイッチを使用してターミネーターを起動するか、起動後に任意のプロファイルに手動で切り替えることができます。
答え2
ターミナルマルチプレクサ tmux を探していますか。
答え3
これは、私が使用していた頃、terminator
多数のターミナルを開いてアプリケーションを実行するために使用していた rc ファイルです。これを に保存します.config/terminator/config
。
[global_config]
title_hide_sizetext = True
enabled_plugins = LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler
[keybindings]
[profiles]
[[default]]
font = DejaVu Sans Mono 9
cursor_blink = False
scrollback_infinite = True
[layouts]
[[default]]
[[[root]]]
position = -4:0
type = Window
order = 0
parent = ""
size = 1072, 1884
[[[grand]]]
position = 536
type = HPaned
order = 0
parent = root
[[[left]]]
position = 942
type = VPaned
order = 0
parent = grand
[[[right]]]
position = 942
type = VPaned
order = 1
parent = grand
[[[terminal1]]]
profile = default
type = Terminal
order = 0
parent = left
command = "cd ~/code/foo; bash"
[[[terminal2]]]
profile = default
type = Terminal
order = 1
parent = left
command = "cd ~/bar/baz; bash"
[[[terminal3]]]
profile = default
type = Terminal
order = 1
parent = right
command = ""
[[[terminal4]]]
profile = default
type = Terminal
order = 0
parent = right
command = "cmus; bash"
[plugins]
編集:この情報は、おそらくかなり前のスレッドの Terdon の投稿から得たものであることに注意してください。私はこのセットアップを数か月使用していますが、ここでの Terdon の投稿は非常に見覚えがあります。
答え4
Terminator 端末エミュレータを分割するためのラッパー スクリプト https://github.com/AlekseyChudov/terminator-split