From 0447df4911cfbe238069f997bc53b1138d5a0c9c Mon Sep 17 00:00:00 2001 From: sd886393 Date: Fri, 14 Sep 2018 17:18:57 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=E3=80=91sd886393=20=E6=8F=90=E4=BA=A4translated=20tech=2020180?= =?UTF-8?q?929=20Getting=20started=20with=20the=20i3=20window=20manager=20?= =?UTF-8?q?on=20linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ted with the i3 window manager on Linux.md | 119 ------------------ ...ted with the i3 window manager on Linux.md | 118 +++++++++++++++++ 2 files changed, 118 insertions(+), 119 deletions(-) delete mode 100644 sources/tech/20180929 Getting started with the i3 window manager on Linux.md create mode 100644 translated/tech/20180929 Getting started with the i3 window manager on Linux.md diff --git a/sources/tech/20180929 Getting started with the i3 window manager on Linux.md b/sources/tech/20180929 Getting started with the i3 window manager on Linux.md deleted file mode 100644 index 20ac244390..0000000000 --- a/sources/tech/20180929 Getting started with the i3 window manager on Linux.md +++ /dev/null @@ -1,119 +0,0 @@ -[sd886393]翻译中 -Getting started with the i3 window manager on Linux -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/windows-tiling-windows-wall.png?itok=mTH7uVrn) - -In my article [5 reasons the i3 window manager makes Linux better][1], I shared the top five reasons I use and recommend the [i3 window manager][2] as an alternative Linux desktop experience. - -In this post, I will walk through the installation and basic configuration of i3 on Fedora 28 Linux. - -### 1\. Installation - -Log into a Fedora workstation and open up a terminal. Use `dnf` to install the required package, like this: -``` -[ricardo@f28i3 ~]$ sudo dnf install -y i3 i3-ipc i3status i3lock dmenu terminator --exclude=rxvt-unicode -Last metadata expiration check: 1:36:15 ago on Wed 08 Aug 2018 12:04:31 PM EDT. -Dependencies resolved. -================================================================================================ - Package                     Arch         Version                           Repository     Size -================================================================================================ -Installing: - dmenu                       x86_64       4.8-1.fc28                        fedora         33 k - i3                          x86_64       4.15-1.fc28                       fedora        323 k - i3-ipc                      noarch       0.1.4-12.fc28                     fedora         14 k - i3lock                      x86_64       2.9.1-2.fc28                      fedora         33 k - i3status                    x86_64       2.12-1.fc28                       updates        62 k - terminator                  noarch       1.91-4.fc28                       fedora        570 k -Installing dependencies: - dzen2                       x86_64       0.8.5-21.20100104svn.fc28         fedora         60 k - -... Skipping dependencies/install messages - -Complete! -[ricardo@f28i3 ~]$ -``` - -**Note:** In this command, I'm explicitly excluding the package `rxvt-unicode` because I prefer `terminator` as my terminal emulator. - -Depending on the status of your system, it may install many dependencies. Wait for the installation to complete successfully and then reboot your machine. - -### 2. First login and initial setup - -After your machine restarts, you're ready to log into i3 for the first time. In the GNOME Display Manager (GDM) screen, click on your username but—before typing the password to log in—click on the small gear icon and change the session to i3 instead of GNOME, like this: - -![](https://opensource.com/sites/default/files/uploads/i3_first_login_small.png) - -Type your password and click `Sign In`. On your first login, you are presented with the i3 configuration screen: - -![](https://opensource.com/sites/default/files/uploads/i3_first_configuration_small.png) - -Press `ENTER` to generate a config file in your `$HOME/.config/i3` directory. Later you can use this config file to further customize i3's behavior. - -On the next screen, you need to select your `Mod` key. This is important, as the `Mod` key is used to trigger most of i3's keyboard shortcuts. Press `ENTER` to use the default `Win` key as the `Mod` key. If you don't have a `Win` key on your keyboard or prefer to use `Alt` instead, use the arrow key to select it and press `ENTER` to confirm. - -![](https://opensource.com/sites/default/files/uploads/i3_generate_config_small.png) - -You're now logged into your i3 session. Because i3 is a minimalist window manager, you see a black screen with the status bar on the bottom: - -![](https://opensource.com/sites/default/files/uploads/i3_start_small.png) - -Next, let's look at navigating in i3. - -### 3\. Basic shortcuts - -Now that you're logged into an i3 session, you'll need a few basic keyboard shortcuts to get around. - -The majority of i3 shortcuts use the `Mod` key you defined during the initial configuration. When I refer to `Mod` in the following examples, press the key you defined. This will usually be the `Win` key, but it can also be the `Alt` key. - -First, to open up a terminal, use `Mod+ENTER`. Open more than one terminal and notice how i3 automatically tiles them to occupy all available space. By default, i3 splits the screen horizontally; use `Mod+v` to split vertically and press `Mod+h` to go back to the horizontal split. - -![](https://opensource.com/sites/default/files/uploads/i3_3terminal_tiled_small.png) - -To start other applications, press `Mod+d` to open `dmenu`, a simple text-based application menu. By default, `dmenu` presents a list of all applications available on your `$PATH`. Select the application you want to start by using the arrow keys or narrow down the search by typing parts of the application's name. Press `ENTER` to start the selected application. - -![](https://opensource.com/sites/default/files/uploads/i3_dmenu.png) - -If your application does not provide a way to close it, you can use i3 to kill a window by pressing `Mod+Shift+q`. Be careful, as you may lose unsaved work—this behavior depends on each application. - -Finally, to end your session and exit i3, press `Mod+Shift+e`. You are presented with a confirmation message at the top of your screen. Click on `Yes, exit i3` to exit or `X` to cancel. - -![](https://opensource.com/sites/default/files/uploads/i3_exit_small.png) - -This is just an initial list of shortcuts you can use to get around i3. For many more, consult i3's official [documentation][3]. - -### 4\. Replacing GDM - -Using i3 window manager reduces the memory utilization on your system; however, Fedora still uses the default GDM as its login screen. GDM loads several GNOME-related libraries and applications that consume memory. - -If you want to further reduce your system's memory utilization, you can replace GDM with a more lightweight display manager, such as `lightdm`, like this: -``` -[ricardo@f28i3 ~]$ sudo dnf install -y lightdm -[ricardo@f28i3 ~]$ sudo systemctl disable gdm -Removed /etc/systemd/system/display-manager.service. -[ricardo@f28i3 ~]$ sudo systemctl enable lightdm -Created symlink /etc/systemd/system/display-manager.service -> /usr/lib/systemd/system/lightdm.service. -[ricardo@f28i3 ~]$ -``` - -Restart your machine to see the Lightdm login screen. - -Now you're ready to log in and use i3. - -![](https://opensource.com/sites/default/files/uploads/i3_lightdm_small.png) - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/8/getting-started-i3-window-manager - -作者:[Ricardo Gerardi][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/rgerardi -[1]: https://opensource.com/article/18/8/i3-tiling-window-manager -[2]: https://i3wm.org -[3]: https://i3wm.org/docs/userguide.html#_default_keybindings diff --git a/translated/tech/20180929 Getting started with the i3 window manager on Linux.md b/translated/tech/20180929 Getting started with the i3 window manager on Linux.md new file mode 100644 index 0000000000..ade4e98fcc --- /dev/null +++ b/translated/tech/20180929 Getting started with the i3 window manager on Linux.md @@ -0,0 +1,118 @@ +[sd886393]翻译中 +Getting started with the i3 window manager on Linux +====== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/windows-tiling-windows-wall.png?itok=mTH7uVrn) + +在我的文章[5 reasons the i3 window manager makes Linux better][1],我分享了选择 [i3 window manager][2] 作为一种Linux桌面替代方案的最主要五个理由。 +在本篇文章中,我将向大家展示,如何在 Fedora 28 上安装与配置 i3。 + +### 1\. 安装 + +首先进入 Fedora 系统中,打开一个终端。使用 `dnf` 来安装需要的软件包,如下: +``` +[ricardo@f28i3 ~]$ sudo dnf install -y i3 i3-ipc i3status i3lock dmenu terminator --exclude=rxvt-unicode +Last metadata expiration check: 1:36:15 ago on Wed 08 Aug 2018 12:04:31 PM EDT. +Dependencies resolved. +================================================================================================ + Package                     Arch         Version                           Repository     Size +================================================================================================ +Installing: + dmenu                       x86_64       4.8-1.fc28                        fedora         33 k + i3                          x86_64       4.15-1.fc28                       fedora        323 k + i3-ipc                      noarch       0.1.4-12.fc28                     fedora         14 k + i3lock                      x86_64       2.9.1-2.fc28                      fedora         33 k + i3status                    x86_64       2.12-1.fc28                       updates        62 k + terminator                  noarch       1.91-4.fc28                       fedora        570 k +Installing dependencies: + dzen2                       x86_64       0.8.5-21.20100104svn.fc28         fedora         60 k + +... Skipping dependencies/install messages + +Complete! +[ricardo@f28i3 ~]$ +``` + +注意:在这个命令中,我排除了 `rxvt-unicode` 这个包,因为我更喜欢 `terminator` 作为我的终端模拟器。 + +据用户目前的系统状态,在命令执行过程中可能会安装很多依赖。等待所有的依赖安装完成,之后重启你的电脑。 + +### 2. 登录与初始化 + +在你的机器重启之后,你便可以第一次体验 i3 了。在 GNOME Display Manager (GDM),选择你的用户名,之后先别着急输密码,点击下方的密码输入框下方的小齿轮,之后选择 i3 ,像下方这样: + +![](https://opensource.com/sites/default/files/uploads/i3_first_login_small.png) + +输入你的密码,并点击 `Sign In`。在你第一次登入之后,会先看到 i3 的配置界面: + +![](https://opensource.com/sites/default/files/uploads/i3_first_configuration_small.png) + +点击 `ENTER` 就会在 `$HOME/.config/i3` 生成一个配置文件,之后你可以通过这个配置文件来定制化 i3's 的一些行为。 + +在下一屏,你需要选择你的 `Mod` 键。这一步很关键,因为 `Mod` 键通常都会作为 i3's 命令快捷键的发起键。按 `ENTER` 会选择 `Win` 键作为默认的 `Mod` 键。如果你的键盘没有 `Win` 键,用 `Alt` 键做替代,用方向键键选择后按 `ENTER` 确认。 + +![](https://opensource.com/sites/default/files/uploads/i3_generate_config_small.png) + +现在你就登录到了 i3 的系统中。由于 i3 是一个最小化的窗口管理器,你会看到一个黑屏窗口,以及屏幕底端显式的状态栏: + +![](https://opensource.com/sites/default/files/uploads/i3_start_small.png) + +接下来,让我们看看 i3 的如何实际使用。 + +### 3\. 基本的快捷键 + +现在你已经登录到了 i3 的会话中,你需要几个基本的快捷键来应对基本的操作。 + +大多数的 i3 快捷键都会用到之前配置的 `Mod` 键。在下面的例子中,当我提到 `Mod` 键,请根据情况使用你定义的做替换。通常使用 `Win` 键或者 `Alt` 键。 + +首先,打开一个终端,使用 `Mod+ENTER`。重复打开几个终端,观察 i3 是如何自动将它们在桌面中排列。默认情况下, i3 会在水平的方向分割屏幕;使用 `Mod + v` 来垂直分割,再按 `Mod + h` 会恢复水平分割模式。 + +![](https://opensource.com/sites/default/files/uploads/i3_3terminal_tiled_small.png) + +当需要启动其他的应用,按 `Mod + d` 来打开 `dmenu`,一个简单的文字应用菜单。默认情况下,`dmenu` 会呈现出所有在你 `$PATH` 中设置的应用。使用方向键来选择你想启动的应用,同时你可以键入应用的名称,来缩小选择的范围,之后按 `ENTER` 来启动选择的应用。 + +![](https://opensource.com/sites/default/files/uploads/i3_dmenu.png) + +如果你的应用没有提供退出的方法,你可以使用 i3 来关闭对应的窗口,通过按 `Mod + Shift +q`。注意,你可能会丢失未保存的工作内容。 + +最后,当你想关闭会话并退出 i3,按 `Mod + Shift +e`。之后会在窗口的上方提示你是否退出。点击 `Yes, exit i3` 退出,或选择 `X` 来取消。 + +![](https://opensource.com/sites/default/files/uploads/i3_exit_small.png) + +这些就是 i3 中最基本的快捷键,如果想了解更多,请查阅官方文档 [documentation][3]。 + +### 4\. 替换GDM + +使用 i3 window manager 会降低你操作系统的内存占用;然而,Fedora 依然会使用 GDM 作为登录的窗口。GDM 会载入几个与 GNOME 相关的库从而占用内存。 + +如果你想进一步的降低你的内存占用,你可以使用一些更轻量级的窗口管理器来替换 GDM,比如 `lightdm`: +``` +[ricardo@f28i3 ~]$ sudo dnf install -y lightdm +[ricardo@f28i3 ~]$ sudo systemctl disable gdm +Removed /etc/systemd/system/display-manager.service. +[ricardo@f28i3 ~]$ sudo systemctl enable lightdm +Created symlink /etc/systemd/system/display-manager.service -> /usr/lib/systemd/system/lightdm.service. +[ricardo@f28i3 ~]$ +``` + +之后重启你的机器来使用 Lightdm 的登录界面。 + +现在你可以继续登录并使用 i3了。 + +![](https://opensource.com/sites/default/files/uploads/i3_lightdm_small.png) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/8/getting-started-i3-window-manager + +作者:[Ricardo Gerardi][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[sd886393](https://github.com/sd886393) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/rgerardi +[1]: https://opensource.com/article/18/8/i3-tiling-window-manager +[2]: https://i3wm.org +[3]: https://i3wm.org/docs/userguide.html#_default_keybindings