i3 是一個面向高級用戶和開發人員的平鋪窗口管理器。 它非常輕巧且快速。 它的主要特點之一是它是面向文本和鍵盤的窗口管理器,這使得有經驗的用戶能夠以非常快速的方式管理窗口。 是的,它有一個對應物:它的學習曲線有點陡峭,但是一旦你習慣了它,你的生產力就會顯著提高。
突出特點
- 快捷鍵控制
- 正確實現多顯示器模式
- 簡單輕便
- 高度可定制
- 節省空間
安裝步驟
拱形Linux
本教程是使用以下 Arch Linux 版本製作的:
- 發佈時間:2017.11.01
- 內核:4.13.9
- 架構:x86_64
1.安裝i3
在終端中鍵入以下命令:
$ sudo pacman -S i3
當它詢問要安裝哪些軟件包時,顯示可能的選項,只需按 Enter 鍵,它就會安裝所有必要的軟件包。
2.編輯Xinitrc
在終端中鍵入以下命令:
$ echo "exec i3" >> ~/.xinitrc
如果您安裝了另一個窗口管理器或桌面環境,您可以通過桌面管理器選擇 i3 作為窗口管理器。
如果您沒有桌面管理器來選擇 i3,或者您希望它作為您獨特的窗口管理器,請刪除或註釋系統中安裝的其他窗口管理器/桌面環境的行。 它們也被放置在 Xinitrc 中。
3. 安裝 Xorg
$ sudo pacman -S xorg-server xorg-xinit
4.啟動i3
$ startx
Fedora
本教程是使用以下內容製作的 Fedora 建造:
- 發布: Fedora 27工作站
- 內核:4.13.9-300.fc27.x86_64
- 架構:x86_64
1.安裝i3
在終端中鍵入以下命令:
$ dnf install i3
2. 重啟並在顯示管理器中選擇 i3
它應該是這樣的:
選擇 i3,登錄並享受!
Ubuntu
本教程是使用以下 Ubuntu 版本製作的:
- 發布:Xubuntu 17.10
- 內核:4.13.0-16-generic
- 架構:x86_64
1.安裝i3
在終端中鍵入以下命令:
$ sudo apt-get install i3
2.停用Xubuntu窗口管理器(可能因發行版而異)
打開“會話和啟動”並轉到“會話”選項卡。
對於 xfwm4,將“立即”選項更改為“從不”。
對於 xfdesktop,將“立即”選項更改為“從不”。
點擊 ‘Save 會議’
3.激活i3窗口管理器
現在,留在“會話和啟動”中並轉到“應用程序自動啟動”選項卡。
單擊“添加”按鈕並按照圖片填寫表格:
單擊確定。
點擊 close.
4.從其他窗口管理器中刪除鍵盤快捷鍵
打開“鍵盤”對話框並選擇“應用程序快捷方式”選項卡:
刪除所有快捷方式和 close.
5.配置i3
- 在您的主目錄中創建一個名為“.i3”的文件夾。 路徑應如下所示:/home/”yourUsernameHere”/.i3
- 在“.i3”目錄中創建一個名為“config”的新文件
- 使用文本編輯器打開文件並粘貼以下文本:
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:monospace 8
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesn’t scale on retina/hidpi displays.
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec xfce4-terminal
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
bindsym $mod+d exec dmenu_run
# For use with xfce4 whisker popup menu in Mint XFCE:
# bindsym $mod+Shift+d exec dmenu_run
# bindsym $mod+d exec --no-startup-id xfce4-popup-whiskermenu
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+semicolon move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+h split h
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+d focus child
# switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
#-old-#bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
bindsym $mod+Shift+e exec xfce4-session-logout
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the window’s width.
# Pressing right will grow the window’s width.
# Pressing up will shrink the window’s height.
# Pressing down will grow the window’s height.
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym semicolon resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
#-old-#bar {
#-old-# status_command i3status
#-old-#}
exec --no-startup-id nitrogen --restore
exec --no-startup-id synergy
6.重新啟動並享受!
這看起來很難,我該如何使用它?
正如我之前所說,i3 的學習曲線很陡峭。 但不要驚慌! 官網有很多文檔: i3 用戶指南
打開應用程序
在 i3 中打開應用程序的方法是按下分配的 Mod 按鈕和另一個鍵。 就我而言,我已將 Windows 鍵設置為 Mod 按鈕。 因此對於 example, 如果我想打開終端,我只需按 WindowsKey + Enter.
你打開的所有窗口都會平鋪,在屏幕上重新排列,所以這就是一些打開的窗口的樣子:
當然你可以設置 i3 以不同的方式排列窗口,看看官方文檔:)。
關閉窗口
到 close windows,你必須點擊:Mod + Shift + Q。在我的例子中:WindowsKey + Shift + Q。
使用工作區
要更改工作區,只需點擊:Mod + Num。 其中 Num 目標工作區的編號。 為了 example,如果我想進入工作區 2,我必須按:WindowsKey + 2。
包起來
回顧 i3 後,我可以說它是一個非常好的窗口管理器。 我可以感受到輕盈,並以極快的方式管理窗戶! 當然,我必須花一點時間閱讀文檔,但相信我,這真的很值得。 我建議你至少看看它。