尝试使用i3 window manager

code

尝试使用i3 window manager

九月下旬,我把博客从hexo迁移到了wordpress。某一天,我正在修改博客主题的时候,陪我度过了无数游戏时光的笔记本——神船Z7D3 突然熄火,开始我并没有太在意这点,因为这台笔记本过热自动关机在以前是常有的事。然而我在后续的检查中发现出现了一个很严重的问题,只要接了电源,我的笔记本就会在启动之后很快自动熄火,这时候我才意识到问题的棘手。之后找了一个修电脑的朋友咨询了一下,问题依然无法解决,并被告知可以通过淘宝更换主板。在淘宝上找了几家店,选中了其中一家,将主板拆了寄过去(然后被坑了又把主板拿回来了,损失了40块钱的邮费)

新的电脑还没拿到,之前一直嫖的Nova大佬的电脑在用,现在终于换了个人嫖了台笔记本用。在nova大佬的推荐下安装了fedora和i3 window manager , 这是我第一次把linux作为日常操作系统使用,感觉还是有些许不习惯,一开始对于这种只有黑框框的桌面我是拒绝的,但在用过一段时间之后还是真香。

安装i3

1
sudo dnf install i3 i3status dmenu i3lock xbacklight feh 

从网上抄的简介

  • i3 is the main window manager package.
  • i3status is a utility to generate a string with information to be displayed in the i3bar.
  • dmenu is a utility to launch our apps in the i3 desktop.
  • xbacklight is a utility to set our laptop’s screen brightness.
  • feh is a utility to set a wallpaper.

这样就安装好了i3和一些配套工具,之后登出Gnome,在登录的时候选择i3就好了,第一次进入需要选择默认的$mod键位置,之后也可以在配置文件(~/.config/i3/config)中改

i3多显示器配置

安装lxrandr进行配置,一看就会。

1
sudo dnf install lxrandr

Terminal

按$mod+Enter可以开启terminal,但是i3默认的terminal实在是太丑了,还是切换回Gnome-terminal比较好。编辑配置文件,找到start a terminal,将i3-sensible-terminal改为gnome-terminal

1
2
3
# start a terminal
#bindsym $mod+Return exec i3-sensible-terminal
bindsym $mod+Return exec gnome-terminal

i3锁屏

配置i3快捷键锁屏,编辑配置文件,添加下列内容

1
2
3
# lock the screen
bindsym $mod+l exec i3lock -i xxx.png
# 后面的[-i xxx.png]是锁屏壁纸,如果锁屏就想大白屏的话可以省略

i3截图

还是Gnome那一套,不过绑定了i3的快捷键

1
2
3
# Screen Shot 
bindsym --release $mod+Shift+s exec gnome-screenshot -a
# 注意 --release 表示释放时执行,不能省略

i3通过键盘fn键进行音量控制

1
2
3
4
# Media volume controls
bindsym XF86AudioMute exec amixer sset 'Master' toggle
bindsym XF86AudioLowerVolume exec amixer sset 'Master' 5%-
bindsym XF86AudioRaiseVolume exec amixer sset 'Master' 5%+

中文输入法

命令行执行ibus-setup进行设置,然后将输入法设置为开启i3时自动启动

1
2
# Start with ibus deamon
exec --no-startup-id ibus-daemon

配置i3 status bar

根据官网的指示,创建了~/.config/i3status/config

然后编辑如下,直接抄了大佬的配置然后稍微改了改

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
 i3status configuration file.
# see "man i3status" for documentation.

# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!

general {
colors = true
interval = 1
}

order += "volume headphones"
order += "cpu_temperature 0"
#order += "cpu_temperature 1"
order += "disk /"
order += "disk /home"
order += "ipv6"
order += "wireless _first_"
order += "ethernet _first_"
order += "battery all"
order += "load"
order += "tztime local"

wireless _first_ {
format_up = "W: (%quality at %essid) %ip"
format_down = "W: down"
}

ethernet _first_ {
# if you use %speed, i3status requires root privileges
format_up = "E: %ip (%speed)"
format_down = "E: down"
}

cpu_temperature 0 {
format = "CPU 0: %degrees°"
path = "/sys/devices/platform/coretemp.0/hwmon/hwmon4/temp1_input"
max_threshold = 75
}

#cpu_temperature 1 {
# format = "CPU 1: %degrees°"
# path = "/sys/devices/platform/coretemp.0/hwmon/hwmon4/temp2_input"
# max_threshold = 75
#}

battery all {
format = "%status %percentage %remaining"
}

tztime local {
format = "%Y-%m-%d %H:%M:%S"
}

load {
format = "%1min"
}

disk "/" {
format = "[/] %avail"
}

disk "/home" {
format = "[~] %avail"
}

volume headphones {
format = "Volume : %volume"
format_muted = "Volume:muted"
mixer = "Headphone"

}

本文作者:Keshane

本文链接: https://keshane.moe/2019/11/01/using-i3-window-manager/

评论

您所在的地区可能无法访问 Disqus 评论系统,请切换网络环境再尝试。