Skip to content

ubuntu安装terminator

约 881 字大约 3 分钟

UbuntuTerminator

2025-01-07

介绍

MacOS中使用iTerm2,现在用ubuntu系统,发现不能使用iTerm,查了一下使用terminator替换。

安装terminator

使用apt安装terminator

$ sudo apt install terminator
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  ibus-data ibus-gtk4 python3-ibus-1.0
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  gir1.2-keybinder-3.0 libkeybinder-3.0-0 python3-configobj python3-psutil
Suggested packages:
  python-configobj-doc python-psutil-doc
The following NEW packages will be installed:
  gir1.2-keybinder-3.0 libkeybinder-3.0-0 python3-configobj python3-psutil terminator
0 upgraded, 5 newly installed, 0 to remove and 8 not upgraded.
Need to get 577 kB of archives.
After this operation, 3,508 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy/universe amd64 libkeybinder-3.0-0 amd64 0.3.2-1.1 [8,916 B]
Get:2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy/universe amd64 gir1.2-keybinder-3.0 amd64 0.3.2-1.1 [3,168 B]
Get:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy/main amd64 python3-configobj all 5.0.6-5 [34.8 kB]
Get:4 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy/main amd64 python3-psutil amd64 5.9.0-1build1 [158 kB]
Get:5 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy/universe amd64 terminator all 2.1.1-1 [372 kB]
Fetched 577 kB in 6s (105 kB/s)     
Selecting previously unselected package libkeybinder-3.0-0:amd64.
(Reading database ... 223458 files and directories currently installed.)
Preparing to unpack .../libkeybinder-3.0-0_0.3.2-1.1_amd64.deb ...
Unpacking libkeybinder-3.0-0:amd64 (0.3.2-1.1) ...
Selecting previously unselected package gir1.2-keybinder-3.0.
Preparing to unpack .../gir1.2-keybinder-3.0_0.3.2-1.1_amd64.deb ...
Unpacking gir1.2-keybinder-3.0 (0.3.2-1.1) ...
Selecting previously unselected package python3-configobj.
Preparing to unpack .../python3-configobj_5.0.6-5_all.deb ...
Unpacking python3-configobj (5.0.6-5) ...
Selecting previously unselected package python3-psutil.
Preparing to unpack .../python3-psutil_5.9.0-1build1_amd64.deb ...
Unpacking python3-psutil (5.9.0-1build1) ...
Selecting previously unselected package terminator.
Preparing to unpack .../terminator_2.1.1-1_all.deb ...
Unpacking terminator (2.1.1-1) ...
Setting up libkeybinder-3.0-0:amd64 (0.3.2-1.1) ...
Setting up gir1.2-keybinder-3.0 (0.3.2-1.1) ...
Setting up python3-psutil (5.9.0-1build1) ...
Setting up python3-configobj (5.0.6-5) ...
Setting up terminator (2.1.1-1) ...
update-alternatives: using /usr/bin/terminator to provide /usr/bin/x-terminal-emulator (x-terminal-e
mulator) in auto mode
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu3) ...
Processing triggers for libc-bin (2.35-0ubuntu3.5) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...

设置默认终端

快捷键Ctrl+Alt+T默认终端

需要设置一下Ctrl+Alt+T默认终端为terminator,使用如下命令:

$ gsettings set org.gnome.desktop.default-applications.terminal exec /usr/bin/terminator
$ gsettings set org.gnome.desktop.default-applications.terminal exec-arg "-x"

设置完成之后Ctrl+Alt+T唤起的就是terminator终端了,如果想换回默认的设置使用如下命令:

$ gsettings reset org.gnome.desktop.default-applications.terminal exec
$ gsettings reset org.gnome.desktop.default-applications.terminal exec-arg

右键默认终端

通过以上设置之后,通过终端启动快捷键打开的就是Terminator了。但是在文件夹内右键选择在终端打开,还是会使用系统默认的终端,这是因为: nautilus-open-terminal uses GAppInfo to launch the terminal process, which uses a hard coded list of terminal emulator 可以参考Ask Ubuntu的解决方法。

$ sudo apt-get remove gnome-terminal
[sudo] password for tdy: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gnome-terminal-data ibus-data ibus-gtk4 python3-ibus-1.0
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  gnome-terminal nautilus-extension-gnome-terminal
0 upgraded, 0 newly installed, 2 to remove and 8 not upgraded.
After this operation, 793 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 223750 files and directories currently installed.)
Removing nautilus-extension-gnome-terminal (3.44.0-1ubuntu1) ...
Removing gnome-terminal (3.44.0-1ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu3) ...
Processing triggers for libglib2.0-0:amd64 (2.72.4-0ubuntu2.2) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...
$ sudo ln -s /usr/bin/terminator /usr/bin/gnome-terminal

参考

Ubuntu用Terminator+ZSH打造好用的终端开发环境