如何在Arch Linux搭建高效便捷的平鋪式桌面
一不注意竟然已經(jīng)三個(gè)多月沒寫文章了,十一月份總算找到感覺比較滿意的實(shí)習(xí)工作了,同時(shí)把近視給弄好了,已經(jīng)有十多年沒有這么清晰地看過這個(gè)世界了:-D
前言
關(guān)于ArchLinux請(qǐng)自己谷歌度娘,由于整個(gè)工作環(huán)境都是自己從頭開始搭建的,最是熟悉和順手,再加上神器yaourt,滾動(dòng)更新(一年多來未滾掛過),十分給力的Wiki,簡(jiǎn)直愛不釋手。
筆者已經(jīng)在主力機(jī)上運(yùn)行這套工作環(huán)境一年多,暫未感到任何不適。
如果對(duì)Linux不是很熟悉且不太樂于折騰的請(qǐng)繞過。
搭建完成后大概是下面這個(gè)樣子:
桌面使用i3-gaps(i3wm的分支)+py3status+i3lock+LilyTerm。
- 選擇平鋪?zhàn)烂婀芾砥魇且驗(yàn)榭梢宰詣?dòng)排列所有打開的窗口,所有窗口操作使用快捷鍵實(shí)現(xiàn)、最大化利用工作區(qū)、最大化利用屏幕空間、占用資源小。
- 選擇i3-gaps是因?yàn)閕3wm的本身配置非常簡(jiǎn)單,i3-gaps在它的基礎(chǔ)之上增加窗口間隙調(diào)整的支持,方便把桌面弄得更漂亮一些。
- 選擇py3staus是因?yàn)樗С指嗟牟寮蛯傩耘渲谩=貓D中右下角顯示的信息分別是:內(nèi)存 內(nèi)存使用率|cpu使用率|cpu溫度|下行速度 上行速度|未讀郵件數(shù)|當(dāng)前時(shí)間|音量|單機(jī)截圖|DPMS|其他軟件。
- 選擇LilyTerm是因?yàn)橐子谂渲煤蛯?duì)中文支持比較好。
整個(gè)桌面最多可以開啟10個(gè)工作區(qū),我的布置是這樣的:
- 窗口1(1:Info)用來運(yùn)行g(shù)lances+系統(tǒng)命令。
- 窗口2(2:Web)運(yùn)行瀏覽器。
- 窗口3~8(3~8:Work)運(yùn)行開發(fā)相關(guān)的程序。
- 窗口9(9:Other)虛擬機(jī)運(yùn)行windows10。
- 窗口10(10:Other)運(yùn)行音樂播放器。
- 同時(shí)在一個(gè)可切換顯示和隱藏的小窗口中運(yùn)行ydcv,需要翻譯的時(shí)候就切換出來相當(dāng)方便。
我說這么多1 2 3 4…………只為了說明一點(diǎn):只要習(xí)慣了自己配置的快捷鍵和空間布局,工作效率颼颼地往上升。習(xí)慣了在平鋪式的桌面中開發(fā)后,再回到windows這類層疊式的有種生不如死的感覺= =
基本系統(tǒng)的安裝
ArchLinux的Wiki是十分完善的,且大多數(shù)常用的文檔都有中文版,系統(tǒng)的安裝主要也是參照Installation guide (簡(jiǎn)體中文)),如果按照以下流程安裝系統(tǒng)時(shí)和官方Wiki有沖突,以官方Wiki為準(zhǔn)。
- 執(zhí)行ping www.baidu.com測(cè)試網(wǎng)絡(luò)是否可用,安裝過程中需要用到網(wǎng)絡(luò)。
- 執(zhí)行timedatectl set-ntp true設(shè)置時(shí)間自動(dòng)同步。
- 執(zhí)行fdisk -l查看要安裝的目標(biāo)硬盤,并用fdisk對(duì)硬盤進(jìn)行操作,我要把系統(tǒng)安裝到/dev/sda這個(gè)硬盤中。
- 執(zhí)行fdisk /dev/sda,其中/dev/sda是步驟3中找到的,fdisk的詳細(xì)使用方法請(qǐng)查閱Wiki,如果你的硬盤是GPT磁盤分區(qū),要記得創(chuàng)建一個(gè)EFI分區(qū)。
- 我是MBR磁盤分區(qū),在進(jìn)入fdisk工具后:
- 重復(fù)執(zhí)行d命令直到刪除所有已有分區(qū)。
- 執(zhí)行n命令創(chuàng)建分區(qū),Partition type、Partition number、First sector直接回車用默認(rèn)值,Last sector輸入+512M表示給該分區(qū)分配512M大小的空間。
- 執(zhí)行n命令創(chuàng)建根分區(qū),分配45G的空間
- 執(zhí)行n命令并一路回車,把硬盤所有剩余空間都給home分區(qū), 如果有需要的話也可以選擇再分配一個(gè)swap分區(qū)。
- 執(zhí)行p命令查看是否和預(yù)想中的分區(qū)情況一致。
- 如果上一個(gè)步驟沒問題的話,執(zhí)行w命令保存并退出。
- 我是MBR磁盤分區(qū),在進(jìn)入fdisk工具后:
- 執(zhí)行mkfs.ext4 /dev/sda1格式化/dev/sda1分區(qū)為EXT4格式。
- 執(zhí)行mkfs.ext4 /dev/sda2格式化/dev/sda2分區(qū)為EXT4格式。
- 執(zhí)行mkfs.ext4 /dev/sda3格式化/dev/sda3分區(qū)為EXT4格式。
- 執(zhí)行mount /dev/sda2 /mnt掛載根分區(qū)。
- 執(zhí)行mkdir /mnt/boot和mkdir /mnt/home分別創(chuàng)建boot分區(qū)和home分區(qū)的掛載點(diǎn)。
- 執(zhí)行mount /dev/sda1 /mnt/boot和mount /dev/sda3 /mnt/home分別將對(duì)應(yīng)的分區(qū)掛載好。
- 執(zhí)行vim /etc/pacman.d/mirrorlist,刪除不需要的mirror,我只保留了163和中科大的mirror。
- 執(zhí)行pacman -Syy更新mirror數(shù)據(jù)庫(kù)。
- 執(zhí)行pacstrap /mnt base base-devel安裝基本系統(tǒng)。
- 執(zhí)行g(shù)enfstab -U /mnt >> /mnt/etc/fstab生成fstab文件。
- 執(zhí)行arch-chroot /mnt /bin/bash切換到新安裝的系統(tǒng)上。
- 執(zhí)行pacman -S vim安裝vim。
- 執(zhí)行l(wèi)n -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime設(shè)置時(shí)區(qū)。
- 執(zhí)行hwclock --systohc --utc設(shè)置時(shí)間標(biāo)準(zhǔn) 為 UTC。
- 執(zhí)行vim /etc/locale.gen修改本地化信息,移除en_US.UTF-8 UTF-8、zh_CN.UTF-8 UTF-8、zh_TW.UTF-8 UTF-8前面的#后保存。
- 執(zhí)行l(wèi)ocale-gen生成本地化信息。
- 執(zhí)行echo LANG=en_US.UTF-8 > /etc/locale.conf將系統(tǒng) locale 設(shè)置為en_US.UTF-8.
- 執(zhí)行echo myhostname > /etc/hostname修改主機(jī)名。
- 執(zhí)行systemctl enable dhcpcd設(shè)置dhcpcd自啟動(dòng)。
- 執(zhí)行passwd設(shè)置root密碼。
- 執(zhí)行pacman -S grub os-prober efibootmgr安裝grub、os-prober和efibootmgr。
- 安裝引導(dǎo)程序:
- grub-install --target=i386-pc /dev/sda
- grub-mkconfig -o /boot/grub/grub.cfg
- 執(zhí)行exit。
- 執(zhí)行umount -R /mnt。
- 執(zhí)行reboot
到此為止,基本系統(tǒng)已經(jīng)安裝完成,重啟后登陸root帳號(hào)開始搭建桌面環(huán)境。
搭建桌面環(huán)境
創(chuàng)建用戶和安裝常用的程序
- 執(zhí)行useradd -m yourusername創(chuàng)建新用戶,并執(zhí)行passwd yourusername設(shè)置登陸密碼。
- 執(zhí)行vim /etc/sudoers編輯sudo權(quán)限,復(fù)制一行root ALL=(ALL) ALL, 并替換其中的root為新用戶名,保存并退出。
- 執(zhí)行exit退出root用戶,并登陸新創(chuàng)建的用戶。
- 執(zhí)行sudo pacman -S alsa-utils xf86-video-vesa xorg xorg-xinit安裝聲卡、顯卡及xorg。
- 執(zhí)行sudo pacman -S zsh git unrar zip unzip openssh glances htop iftop screenfetch tree vlc wget net-tools安裝常用程序。
安裝oh-my-zsh
執(zhí)行sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"安裝oh-my-zsh,我們將使用它作為默認(rèn)shell。
執(zhí)行vim .zshrc編輯配置文件,修改ZSH_THEME的值可以更改shell的主題,主題可以到這里來查看,我個(gè)人比較喜歡使用rkj-repos這個(gè)主題。
在配置文件最底端加入一下代碼段為一些命令創(chuàng)建別名:
- alias ll='ls -l'
- alias la='ls -a'
- alias vi='vim'
- alias svi='sudo vim'
- alias grep='grep --color=auto'
- alias install='sudo pacman -S'
- alias remove='sudo pacman -Rcn'
- alias upgrade='sudo pacman -Syu'
- alias findProc='ps -ef | grep '
- alias docker='sudo docker '
- alias cls='printf "\033c"'
編輯完成后保存并退出,執(zhí)行source .zshrc更新。
插件和其他的配置根據(jù)自己所需到這里查詢配置。
安裝yaourt
執(zhí)行sudo vim /etc/pacman.conf,在文件最底部加入以下文本后保存并退出:
- [archlinuxcn]
- SigLevel = Optional TrustAll
- Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch
然后執(zhí)行sudo pacman -Syu yaourt更新倉(cāng)庫(kù)數(shù)據(jù)庫(kù)并安裝yaourt。
接著再執(zhí)行install archlinuxcn-keyring安裝archlinuxcn的keyring,不然有些pacman的軟件包無法安裝。
配置桌面環(huán)境
配置i3wm
- 執(zhí)行install i3lock i3status compton dmenu feh, compton如果沒有裝的話會(huì)一些窗口效果會(huì)消失。因?yàn)閕3wm是沒有桌面圖標(biāo)這些東西的,所以我們通過dmenu來打開應(yīng)用程序。feh是用來設(shè)置壁紙的。
- 執(zhí)行yaourt i3-gaps安裝i3wm。
安裝好i3-gaps后,編輯~/.i3/config文件配置i3wm的快捷鍵和外觀等,其中mod鍵我設(shè)置為win鍵。
以下是我的快捷方式:
窗口管理
win+0 ~ win+9:切換工作區(qū)。
win+左:聚焦到左邊的窗口。
win+右:聚焦到右邊的窗口。
win+上:聚焦到上邊的窗口。
win+下:聚焦到下邊的窗口。
win+shift+左:移動(dòng)當(dāng)前聚焦的窗口到左邊。
win+shift+右:移動(dòng)當(dāng)前聚焦的窗口到右邊。
win+shift+上:移動(dòng)當(dāng)前聚焦的窗口到上邊。
win+shift+下:移動(dòng)當(dāng)前聚焦的窗口到下邊。
win+shift+0 ~ win+shift+9:將當(dāng)前聚焦的窗口移動(dòng)到指定的工作區(qū)中。
win+H:窗口水平分離,即新創(chuàng)建的窗口將會(huì)出現(xiàn)在當(dāng)前窗口的右側(cè)。win+V:窗口垂直分離,即新創(chuàng)建的窗口將會(huì)出現(xiàn)在當(dāng)前窗口的下側(cè)。
win+R:調(diào)整當(dāng)前聚焦的窗口的大小,在按完快捷鍵后再按方向鍵即可調(diào)整。win+F:切換當(dāng)前聚焦的窗口為全屏/非全屏。
ctrl+alt+W:關(guān)閉當(dāng)前聚焦的窗口。
win+shift+space:使當(dāng)前聚焦的窗口浮動(dòng)。
win+space:在浮動(dòng)的窗口和非浮動(dòng)的窗口之間切換焦點(diǎn)。
win+T:切換窗口顯示為邊框+標(biāo)題欄。
win+Y:切換窗口顯示為只有1像素的邊框。
win+U:切換窗口顯示為沒有邊框也沒有標(biāo)題欄,默認(rèn)為這種顯示方式,因?yàn)檫吙蚝蜆?biāo)題欄太丑而且太占空間了= =。
win+shift+ -:移動(dòng)當(dāng)前窗口到scratchpad中,即可以在需要的時(shí)候?qū)⑵湔{(diào)出來,不需要時(shí)將其隱藏。win+ -:切換scratchpad中的窗口的顯示與否,該功能我最常將用來創(chuàng)建一個(gè)運(yùn)行ydcv進(jìn)程的窗口來翻譯,相當(dāng)方便。
系統(tǒng)命令
win+回車:打開一個(gè)新的終端。
win+E:打開dmenu,會(huì)在屏幕頂部出現(xiàn)一個(gè)黑色輸入框,輸入程序名字按回車就會(huì)打開程序。
win+L:鎖屏。
win+E:打開資源管理器。
fn+音量+:音量上調(diào)5%。fn+音量-:音量下調(diào)5%。
win+shift+Q:調(diào)出系統(tǒng)命令。
在調(diào)出系統(tǒng)命令后,按O注銷會(huì)話、S關(guān)機(jī)、R重啟、Esc取消。
win+shift+C:重新加載i3wm的配置文件。
win+shift+R:重新啟動(dòng)i3wm,不會(huì)丟失已經(jīng)打開的窗口等信息。
win+shift+E:關(guān)閉i3wm,將會(huì)導(dǎo)致所有窗口被關(guān)閉。
以下是我的配置:
- #===============設(shè)置字體===============
- font pango:Source Code Pro, EmojiOne Color 10
- #===============定義$mod鍵為win鍵===============
- # customized
- set $mod Mod4
- #===============設(shè)置窗口邊框===============
- new_window none
- bindsym $mod+t border normal
- bindsym $mod+y border pixel 1
- bindsym $mod+u border none
- #===============狀態(tài)欄===============
- bindsym $mod+m bar mode toggle
- bar {
- i3bar_command i3bar -t
- # status_command i3status
- status_command py3status
- position bottom
- modifier Shift
- separator_symbol " | "
- colors {
- background #000000CC
- #statusline #000000FF
- separator #B8F788
- focused_workspace #B8F788 #000000AA
- active_workspace #FFFFFF #FFFFFFAA
- inactive_workspace #AAAAAA #000000AA #AAAAAA
- urgent_workspace #E57B85 #000000AA
- }
- }
- #===============窗口間距===============
- gaps inner 6
- gaps outer 0
- smart_gaps on
- #===============系統(tǒng)命令===============
- set $mode_system 注銷(O) 關(guān)機(jī)(S) 重啟(R) 取消(Esc)
- bindsym $mod+shift+q mode "$mode_system"
- mode "$mode_system" {
- bindsym o exec i3-msg exit
- bindsym s exec systemctl poweroff
- bindsym r exec systemctl reboot
- bindsym Escape mode "default"
- }
- #===============鼠標(biāo)聚焦===============
- focus_follows_mouse no
- #===============鎖屏快捷鍵===============
- # bindsym Mod4+l exec --no-startup-id i3lock -i '/home/huang/Pictures/Wallpapers/universe.png'
- bindsym Mod4+l exec --no-startup-id i3lock -i 'path/to/lock/screen/wallpaper'
- #===============自動(dòng)啟動(dòng)fcitx===============
- exec --no-startup-id fcitx
- bindsym $mod+e exec nautilus
- #===============音量控制===============
- bindsym XF86AudioRaiseVolume exec --no-startup-id amixer -q sset Master 5%+
- bindsym XF86AudioLowerVolume exec --no-startup-id amixer -q sset Master 5%-
- #===============浮動(dòng)窗口===============
- # use Mouse+Mod1 to drag floating windows to their wanted position
- #floating_modifier $mod
- #===============打開終端===============
- # bindsym $mod+Return exec i3-sensible-terminal
- bindsym $mod+Return exec lilyterm
- #===============關(guān)閉窗口===============
- bindsym Control+Mod1+w kill
- #===============打開dmenu===============
- # start dmenu (a program launcher)
- bindsym $mod+d exec dmenu_run
- # There also is the (new) i3-dmenu-desktop which only displays applications
- # bindsym Mod1+d exec --no-startup-id i3-dmenu-desktop
- # change focus
- #bindsym $mod+$left focus left
- #bindsym $mod+$down focus down
- #bindsym $mod+$up focus up
- #bindsym $mod+$right 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+$left move left
- #bindsym $mod+Shift+$down move down
- #bindsym $mod+Shift+$up move up
- #bindsym $mod+Shift+$right move right
- # alternatively, you can use the cursor keys:
- #===============窗口移動(dòng)===============
- bindsym $mod+Shift+Left move left
- bindsym $mod+Shift+Down move down
- bindsym $mod+Shift+Up move up
- bindsym $mod+Shift+Right move right
- #===============窗口拆分模式===============
- bindsym $mod+h split h
- bindsym $mod+v split v
- #===============切換全屏===============
- bindsym $mod+f fullscreen toggle
- #===============切換布局模式===============
- #bindsym $mod+s layout stacking
- #bindsym $mod+w layout tabbed
- #bindsym Mod1+e layout toggle split
- #===============切換窗口浮動(dòng)===============
- bindsym $mod+Shift+space floating toggle
- #===============浮動(dòng)/平鋪聚焦切換===============
- bindsym $mod+space focus mode_toggle
- #===============聚焦到父窗口===============
- #bindsym $mod+a focus parent
- #===============聚焦到子窗口===============
- #bindsym Mod1+d focus child
- #===============添加窗口到存儲(chǔ)===============
- bindsym $mod+Shift+minus move scratchpad
- #===============切換存儲(chǔ)器中的窗口===============
- # Show the next scratchpad window or hide the focused scratchpad window.
- # If there are multiple scratchpad windows, this command cycles through them.
- bindsym Mod1+minus scratchpad show
- #===============綁定workspace快捷鍵===============
- # switch to workspace
- bindsym $mod+1 workspace 1:Info
- bindsym $mod+2 workspace 2:Web
- bindsym $mod+3 workspace 3:Work
- bindsym $mod+4 workspace 4:Work
- bindsym $mod+5 workspace 5:Work
- bindsym $mod+6 workspace 6:Work
- bindsym $mod+7 workspace 7:Work
- bindsym $mod+8 workspace 8:Other
- bindsym $mod+9 workspace 9:Other
- bindsym $mod+0 workspace 10:Other
- #==============設(shè)置workspace默認(rèn)顯示到LVDS1===============
- workspace "1:Info" output LVDS1
- workspace "2:Web" output LVDS1
- workspace "3:Dev" output LVDS1
- workspace "4:Dev" output LVDS1
- workspace "5:Dev" output LVDS1
- workspace "6:Dev" output LVDS1
- workspace "7:Dev" output LVDS1
- workspace "8:Music" output LVDS1
- workspace "9:Other" output LVDS1
- workspace "10:Other" output LVDS1
- #===============綁定移動(dòng)窗口到指定workspace快捷鍵===============
- # move focused container to workspace
- bindsym $mod+Shift+1 move container to workspace 1:Info
- bindsym $mod+Shift+2 move container to workspace 2:Web
- bindsym $mod+Shift+3 move container to workspace 3:Work
- bindsym $mod+Shift+4 move container to workspace 4:Work
- bindsym $mod+Shift+5 move container to workspace 5:Work
- bindsym $mod+Shift+6 move container to workspace 6:Work
- bindsym $mod+Shift+7 move container to workspace 7:Work
- bindsym $mod+Shift+8 move container to workspace 8:Other
- bindsym $mod+Shift+9 move container to workspace 9:Other
- bindsym $mod+Shift+0 move container to workspace 10:Other
- #===============指定程序打開后出現(xiàn)在指定工作區(qū)===============
- assign [class="chrome"] 2:Web
- # assign [class="idea"] 3:Dev
- # assign [class="VirtualBox"] 9:Other
- #===============重新加載配置===============
- # reload the configuration file
- bindsym $mod+Shift+c reload
- #===============重啟i3===============
- # restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
- bindsym $mod+Shift+r restart
- #===============退出i3===============
- # exit i3 (logs you out of your X session)
- bindsym $mod+Shift+e exec "i3-nagbar -t warning -m '是否確定退出i3? 這將導(dǎo)致所有工作窗口被關(guān)閉.' -b '確定' 'i3-msg exit'"
- #===============調(diào)整窗口大小===============
- # resize window (you can also use the mouse for that)
- mode "resize" {
- # 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"
- }
- #===============綁定調(diào)整窗口大小快捷鍵===============
- bindsym $mod+r mode "resize"
- #===============開啟i3時(shí)自啟動(dòng)項(xiàng)===============
- exec_always --no-startup-id feh --bg-fill path/to/background/image
- exec i3-config-wizard
- exec --no-startup-id i3-msg "workspace 1:Info"
- exec compton &
如果復(fù)制了我的配置文件,請(qǐng)修改path/to/background/image和path/to/lock/screen/wallpaper。
至此i3wm的配置已經(jīng)弄好了,就是這么簡(jiǎn)單= = 關(guān)于i3wm的詳細(xì)配置參考官方文檔。
配置py3status
1. 執(zhí)行yaourt py3status安裝。
py3status的配置文件在~/.i3status中,在配置i3wm的時(shí)候我們已經(jīng)在配置文件中啟用了py3status,在這一部分只需要配置要啟用的模塊即可,所有支持的模塊可以在這里找到。
2. 執(zhí)行install noto-fonts-emoji安裝Emoji字體。
以下是我py3status的配置文件:
- general {
- output_format = "i3bar"
- colors = true
- color_good = "#BBBBBB"
- color_bad = "#CC1616"
- color_degraded = "#55858E"
- interval = 1
- }
- order += "sysdata"
- order += "cpu_usage"
- order += "cpu_temperature 0"
- order += "net_rate"
- order += "imap"
- order += "time"
- order += "volume_status"
- order += "static_string screenshot"
- order += "dpms"
- sysdata {
- format = "📈 {mem_used}G 📉 {mem_used_percent}%"
- color = "#48CCCD"
- }
- cpu_usage {
- format = "🔲 %usage"
- color = "#52D017"
- }
- cpu_temperature 0 {
- format = "♨ %degrees °C"
- max_threshold = 65
- path = "/sys/class/thermal/thermal_zone0/temp"
- color = "#CCFB5D"
- }
- net_rate {
- interfaces = "enp0s25"
- format = "🔻{down} 🔺{up}"
- color = "#FFDB58"
- }
- imap {
- cache_timeout = 60
- format = "📩 {unseen}"
- imap_server = 'imap.gmail.com'
- mailbox = 'INBOX'
- name = 'you/name'
- password = 'you/mail/password'
- port = '993'
- user = 'your/mail'
- new_mail_color = "#F87431#F62217"
- on_click 1 = 'exec google-chrome-stable https://mail.google.com/mail'
- color = "#FCDFFF"
- }
- time {
- format = "🕔 %Y-%m-%d %H:%M:%S"
- color = "#9E7BFF"
- }
- volume_status {
- format = "🔊 {percentage}%"
- cache_timeout = 1
- device = "default"
- thresholds = [
- (0, "#A0CFEC"),
- (10, "#82CAFF"),
- (20, "#79BAEC"),
- (30, "#3BB9FF"),
- (40, "#56A5EC"),
- (50, "#5CB3FF"),
- (60, "#1589FF"),
- (70, "#157DEC"),
- (80, "#306EFF"),
- (90, "#2B65EC")
- ]
- }
- static_string 'screenshot' {
- format = "🖥"
- on_click 1 = "exec gnome-screenshot"
- color = "#C44975"
- }
- dpms {
- format_on = "🖥 DPMS"
- format_off = "🖥 DPMS"
- color_on = "#F9B7FF"
- color_off = "#6B9299"
- }
- 我的配置文件中使用了imap模塊,需要配置郵箱相關(guān)的信息。
- volume_status模塊需要安裝pamixer和alsa-utils。
- 不同的Emoji字體會(huì)造成狀態(tài)欄的圖標(biāo)不一樣,我截圖中使用的是nodejs-emojione,這里的配置使用的是 noto-fonts-emoji,因?yàn)橛X得后者 比較好看= =。
配置LilyTerm
執(zhí)行install lilyterm安裝終端模擬器。
LilyTerm的配置文件在/etc/lilyterm.conf, 不過不建議直接修改配置文件,可以在啟動(dòng)i3wm后打開終端,在終端上右鍵即可進(jìn)行可視化配置。字體我使用的Source Code Pro+Noto Sans CJK SC
配置xinit
執(zhí)行vim ~/.xinitrx編輯xinit配置文件, 這一步的配置關(guān)系到i3wm的啟動(dòng)和搜狗輸入法的使用,將內(nèi)容修改如下:
- export LANG=zh_CN.UTF-8
- export LANGUAGE=zh_CN:en_US
- export LC_CTYPE=en_US.UTF-8
- export GTK_IM_MODULE=fcitx
- export QT_IM_MODULE=fcitx
- export XMODIFIERS=@im=fcitx
- exec i3
- exec sogou-qimpanel
修改完成后執(zhí)行startx就會(huì)發(fā)現(xiàn)桌面環(huán)境啟動(dòng)成功了。
執(zhí)行vim ~/.zshrc,在文件底部加入這一行[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx,這樣以后登陸系統(tǒng)后會(huì)自動(dòng)運(yùn)行startx登陸到桌面中。
搜狗輸入法
在桌面環(huán)境下打開一個(gè)終端(win+回車),執(zhí)行install fcitx-im fcitx-configtool fcitx-sogoupinyin安裝fcitx套件和搜狗輸入法。
安裝完成后右擊狀態(tài)欄最右側(cè)的小鍵盤,在設(shè)置中添加搜狗輸入法,然后重啟系統(tǒng),就會(huì)發(fā)現(xiàn)輸入法可以使用了,輸入法的切換默認(rèn)按鍵為ctrl+space。
Chrome
執(zhí)行install google-chrome安裝Chrome瀏覽器,安裝完成后按win+d調(diào)出dmenu,輸入chrome回車,即可運(yùn)行Chrome。
資源管理器
執(zhí)行install nautilus安裝gnome的資源管理器,安裝完成后可以通過win+e打開。
為了能夠讓nautilus識(shí)別安卓手機(jī),需要執(zhí)行install gvfs-mtp來支持MTP。
安裝PDF閱讀器
執(zhí)行install foxitreader安裝福昕PDF閱讀軟件, 安裝完成后按win+d調(diào)出dmenu,輸入foxitreader回車,即可運(yùn)行foxitreader。
截屏
執(zhí)行install gnome-screenshot安裝gnome的截屏軟件,安裝完成后點(diǎn)擊狀態(tài)欄中的截屏按鈕就會(huì)自動(dòng)截屏。
執(zhí)行yaourt shutter可以安裝功能強(qiáng)大的截圖軟件shutter,安裝完成后按win+d調(diào)出dmenu,輸入shutter回車,即可運(yùn)行shutter。
WPS
執(zhí)行install wps-office安裝wps套件,雖然絕大多數(shù)時(shí)候我都會(huì)在虛擬機(jī)下開windows編輯文檔,但是只是查看的話還是很方便的。
翻譯:ydcv
執(zhí)行install ydcv安裝ydcv,通過它再配scratchpad功能,在簡(jiǎn)單翻譯的情境下比任何翻譯工具都要好用。
結(jié)尾
做到這里差不多桌面環(huán)境都搭建好了,筆者是實(shí)體機(jī)上邊安裝邊寫的文章,大體上不會(huì)有什么問題,如果安裝過程中有疑問或者不對(duì)的地方歡迎提出討論。