Skip to content

Commit e0751c1

Browse files
committed
update README
1 parent 144ca1c commit e0751c1

10 files changed

+137
-87
lines changed

Pictures.zip Pictures.tar.xz

1.46 MB
Binary file not shown.

README-en.md

+22-17
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22

33
---
44

5-
![](arch-i3.jpg)
5+
![](screenshot.png)
66

77
# install & configure
88

99
## install softwares
1010

11+
You can search for package names using the package manager, or search keywords on [pkgs.org](https://pkgs.org) to determine the package name.
12+
1113
- base
1214

13-
- `i3` : in some distributions, `i3` may be a package-group name, that contains i3 wm and other components, `i3-wm` , `i3-gaps`, `i3block` , `i3lock`and`i3status`. And in some distributions, `i3` may only refer to `i3wm`. (you can search keywords on [pkgs.org](https://pkgs.org) to determine the package name.)
14-
- Suitable terminal (see [terminal](#terminal), select a terminal emulator )
15+
- `i3` : in some distributions, `i3` may be a package-group name, that contains i3 wm and other components, `i3-wm` , `i3-gaps`, `i3block` , `i3lock`and`i3status`. And in some distributions, `i3` may only refer to `i3wm`.
16+
- Suitable terminal (see [terminal](#terminal), select a terminal emulator )
1517
- `dmenu` Applications launcher
1618
- `feh` image viewer , show wallpaper
1719

@@ -41,21 +43,24 @@
4143

4244
## configure i3
4345

44-
- Downlod this config and extra it, put `i3` and `i3status` in the `~/.config/` , and put `Pictures`(including some sample wallpapers) in the current user's home directory (`~/`).
46+
- Downlod this config and extra it, put `i3` and `i3status` in the `~/.config/` , and put `Pictures`(including some sample wallpapers) in the current user's home directory (`~/`).
4547

4648
If you need to display the tray icon, you may need to refer to the following section of the [tray Icons](#tray Icons) for configuration.
4749

48-
A simple initial configuration can be done using the script `config-zh.sh`.
50+
A simple initial configuration can be done using the script `config-zh.sh`.
4951

50-
or
52+
or
5153

5254
- execute this command:
5355

5456
```shell
55-
curl -# -L -o i3.zip https://github.com/levinit/i3wm-config/archive/master.zip && unzip i3.zip && cd i3wm-config-master && unzip Pictures.zip && cp -r i3 ~/.config && cp -r Pictures ~/ && chmod +x *.sh && chmod +x */*.sh && ./config-en.sh
57+
curl -# -L -o i3.zip https://github.com/levinit/i3wm-config/archive/master.zip
58+
unzip i3.zip
59+
cd i3wm-config-master
60+
bash config.sh
5661
```
5762

58-
If it show `xrandr: command not found` , you need to install `xorg-xrandr` , then execute the above command again.
63+
If it show `xrandr: command not found` , you need to install `xorg-xrandr` , then execute the above command again.
5964

6065
# Introductions for the configs
6166

@@ -76,7 +81,7 @@ For other i3wm default shortcuts , see the **i3wm related documentation** or vi
7681

7782
The following are the custom shortcuts in this configuration file (Reference vim and windows usage habits).
7883

79-
- `Super` Temporarily display i3bar (will be hidden after releasing the `Super` key)
84+
- `Super` Temporarily display i3bar (will be hidden after releasing the `Super` key)
8085
- `Super`+`m` switch i3bar show/hideen mode
8186

8287
- xfce dropdown terminal `Alt`+`/`
@@ -92,13 +97,13 @@ The following are the custom shortcuts in this configuration file (Reference vim
9297

9398
"PrtSc" is "PrintScreen" key , need `scrot`.
9499

95-
- open filemanager `Super`+`e`
100+
- open filemanager `Super`+`e`
96101

97102
need `thunar`(e-explore)
98103

99-
- close window `Alt`+`F4`
104+
- close window `Alt`+`F4`
100105

101-
- hide window and show the hide window `Super`+`minus` and `Super`+`plus`
106+
- hide window and show the hide window `Super`+`minus` and `Super`+`plus`
102107

103108
"minus" is "-" key ,and "plus" is "+" key. Here, in order to avoid confusion with +, the name is described in English.
104109

@@ -151,7 +156,7 @@ The following are the custom shortcuts in this configuration file (Reference vim
151156
- adjust the volume and brightness ( for laptop)
152157

153158
- volume
154-
- `Fn` and volume key
159+
- `Fn` and volume key
155160
- use `alsamixer` (need alsa-utils)
156161

157162
- `Fn` and brightness key (need a power manager tool , recommend `mate-power-manager`)
@@ -169,7 +174,7 @@ The following are the custom shortcuts in this configuration file (Reference vim
169174
- lock screen
170175

171176
- background path : `~/Pictures/wallpaper/lock/lock.jpg`
172-
- lock : `Super`+`Alt`+`l`
177+
- lock : `Super`+`Alt`+`l`
173178
- unlock : input your user password , then press "Enter" key .
174179

175180

@@ -261,7 +266,7 @@ so , **eDP1** is my display device's name , if your display device's name is not
261266

262267

263268

264-
Or you can try these comands for modification:
269+
Or you can try these comands for modification`xrandr`need`xorg-xrandr`:
265270

266271
```shell
267272
name=`xrandr | sed -n '2p' | cut -d ' ' -f 1`
@@ -274,7 +279,7 @@ If it show `xrandr: command not found` , install `xorg-xrandr` , then excuted co
274279

275280
- not found this package while installing
276281

277-
Maybe this package is another name on your distribution. Using the fuzzy search in your pckage manger, also search the real name in this site https://pkgs.org.
282+
Maybe this package is another name on your distribution. Using the fuzzy search in your package manger, also search the real name in this site https://pkgs.org.
278283

279284
- emoji need a font such as `fonts-symbola ` (perhaps its name is `ttf-symbola`)
280285

@@ -302,7 +307,7 @@ edit `~/.Xresources` add (example) :
302307
Of course, the text under the high screen is too small, you can also adjust the font size (you can use lxappearance).
303308

304309
- turn off waring sound(alarm sound/beep sound)
305-
see[PC speaker](https://wiki.archlinux.org/index.php/PC_speaker)
310+
see[PC speaker](https://wiki.archlinux.org/index.php/PC_speaker)
306311
`echo "blacklist pcspkr" > /etc/modprobe.d/nobeep.conf`
307312
or
308313
`amixer set channel 0% mute`(need `alsa-utils`)

README.md

+12-7
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@
22

33
---
44

5-
![](arch-i3.jpg)
5+
![](screenshot.png)
66

77
# 安装配置
88

99
## 安装软件
1010

11+
可使用包管理器或在[pkgs.org](https://pkgs.org)搜索关键字以确定包名。
12+
1113
- 基本
12-
- `i3 `:某些发行版中`i3`可能为一个包组名,它包含i3窗口管理器和其他组件,`i3-wm``i3-gaps``i3block``i3lock``i3status`,另一些发行版中`i3`可能仅仅指`i3wm`(可在[pkgs.rog](https://pkgs.org)搜索关键字以确定包名)
14+
- `i3 `:某些发行版中`i3`可能为一个包组名,它包含i3窗口管理器和其他组件,`i3-wm``i3-gaps``i3block``i3lock``i3status`,另一些发行版中`i3`可能仅仅指`i3wm`
1315
- 适合的终端(参照下文[终端](#终端) 选择一个终端)
1416
- `dmenu` 程序启动器
1517
- `feh` 图片浏览器,展示壁纸
16-
- 可选
18+
- 配套可选
1719
- `xcompmgr` 终端透明
1820

1921
- `scrot` 截屏(本配置使用的截屏快捷键调用此工具)
@@ -51,10 +53,13 @@
5153
- 直接执行:
5254

5355
```shell
54-
curl -# -L -o i3.zip https://github.com/levinit/i3wm-config/archive/master.zip && unzip i3.zip && cd i3wm-config-master && unzip Pictures.zip && cp -r i3 ~/.config && cp -r Pictures ~/ && chmod +x *.sh && chmod +x */*.sh && ./config-zh.sh
56+
curl -# -L -o i3.zip https://github.com/levinit/i3wm-config/archive/master.zip
57+
unzip i3.zip
58+
cd i3wm-config-master
59+
bash config.sh
5560
```
56-
57-
如果提示`xrandr: command not found`,则需要先安装`xorg-xrandr`再执行上述命令。
61+
62+
如果提示`xrandr: command not found`,则需要先安装`xorg-xrandr`再执行上述命令。
5863

5964
# 本配置的说明
6065

@@ -256,7 +261,7 @@ eDP1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 310mm x
256261

257262
其中的`eDP1`便是我的显示设备名称。如果你的显示设备名称不是`eDP1` ,那么需要修改`exec --no-startup-id xrandr --output eDP1 --primary`这行中`eDP1`为你的显示设备的名字。
258263

259-
或者你可以尝试使用一下命令自动修改
264+
或者你可以使用xrandr(需要安装有`xorg-xrandr`)获取设备信息后自行修改
260265

261266
```shell
262267
name=`xrandr | sed -n '2p' | cut -d ' ' -f 1`

arch-i3.jpg

-169 KB
Binary file not shown.

config-en.sh

100755100644
+19-19
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
#!/bin/sh
2+
echo -e '\e[[1;36m configure i3\e[[0m'
23

3-
echo -e '\e[1;36m configure i3\e[0m'
4+
draw_line
45

5-
echo -e '\e[1;33m================\e[0m'
66
echo -e 'tray icon'
7-
name=`xrandr | sed -n '2p' | cut -d ' ' -f 1`
8-
echo -e 'your display device is '$name
9-
if [ -n $name ]
10-
then
11-
sed -i 's/eDP1/'"$name"'/g' ~/.config/i3/config
7+
name=$(xrandr | sed -n '2p' | cut -d ' ' -f 1)
8+
[[ $name ]] && echo -e echo -e 'your display device is '$name
9+
if [[ -n $name ]]; then
10+
sed -i "s/eDP1/$name/g" ~/.config/i3/config
11+
echo 'setted tray icon'
1212
fi
13-
echo 'setted tray icon'
1413

15-
echo -e '\e[1;33m================\e[0m'
16-
read -p 'Do you use "networkmanager" tray icon ? input y or n:' nmicon
14+
draw_line
1715

18-
if [ $nmicon = y ]
19-
then
16+
read -p "Do you use "networkmanager" tray icon ? input y or n:" nmicon
17+
18+
if [[ $nmicon == y ]]; then
2019
sed -i 's/#exec --no-startup-id nm-applet/exec --no-startup-id nm-applet/' ~/.config/i3/config
2120
echo 'OK,please make sure nm-applet has been installed'
2221
fi
2322

24-
echo -e '\e[1;33m================\e[0m'
23+
draw_line
24+
2525
read -p 'Do you use "xcompmgr"(make the terminal transparent)? input y or n:' xcomp
2626

27-
if [ $xcomp = y ]
28-
then
27+
if [[ $xcomp == y ]]; then
2928
sed -i 's/#exec --no-startup-id xcompmgr &/exec --no-startup-id xcompmgr &/' ~/.config/i3/config
3029
echo 'OK,please make sure xcompmgr has been installed'
3130
fi
3231

33-
echo -e '\e[1;33m================\e[0m'
32+
draw_line
33+
3434
read -p 'Do you use "mate-power-manager" ? input y or n:' matepower
3535

36-
if [ $matepower = y ]
37-
then
36+
if [[ $matepower == y ]]; then
3837
sed -i 's/#exec --no-startup-id mate-power-manager/exec --no-startup-id mate-power-manager/' ~/.config/i3/config
3938
echo 'OK,please make sure mate-power-manager has been installed'
4039
fi
4140

42-
echo -e '\e[1;33m================\e[0m'
41+
draw_line
42+
4343
echo 'Done!More info see README-en.md'

config-zh.sh

100755100644
+29-30
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,57 @@
11
#!/bin/sh
2-
32
echo -e '\e[1;36m配置 i3\e[0m'
43

5-
echo -e '\e[1;33m================\e[0m'
4+
draw_line
5+
66
echo -e '托盘图标'
7-
name=`xrandr | sed -n '2p' | cut -d ' ' -f 1`
8-
echo -e '你的显示设备是'$name
9-
if [ -n $name ]
10-
then
11-
sed -i 's/eDP1/'"$name"'/g' ~/.config/i3/config
7+
name=$(xrandr | sed -n '2p' | cut -d ' ' -f 1)
8+
[[ $name ]] && echo -e '你的显示设备是'$display_dev
9+
if [[ -n $display_dev ]]; then
10+
sed -i "s/eDP1/$display_dev/g" ~/.config/i3/config
11+
echo '托盘图标设置成功'
1212
fi
13-
echo '托盘图标设置成功'
1413

15-
echo -e '\e[1;33m================\e[0m'
16-
read -p '你的输入法是fcitx还是ibus?fcitx输入f,ibus输入i,不使用fcitx或者ibus输入n:' input
14+
draw_line
1715

18-
if [ $input == f ]
19-
then
20-
`sed -i 's/#exec --no-startup-id fcitx/exec --no-startup-id fcitx/' ~/.config/i3/config`
16+
read -p '使用fcitx还是ibus? fcitx输入f,ibus输入i,不使用fcitx或者ibus输入n:' input
17+
18+
if [[ $input == f ]]; then
19+
$(sed -i 's/#exec --no-startup-id fcitx/exec --no-startup-id fcitx/' ~/.config/i3/config)
2120
echo '设置了fcitx'
22-
elif [ $input == i ]
23-
then
21+
elif [ $input == i ]; then
2422
sed -i 's/#exec --no-startup-id ibus/exec --no-startup-id ibus/' ~/.config/i3/config
2523
echo '设置了ibus'
2624
else
27-
echo '你没有使用任何的输入法'
25+
echo '你没有使用任何的输入法工具'
2826
fi
2927

30-
echo -e '\e[1;33m================\e[0m'
28+
draw_line
29+
3130
read -p '你需要使用networkmanager的托盘图标吗?输入y或者n:' nmicon
3231

33-
if [ $nmicon = y ]
34-
then
35-
sed -i 's/#exec --no-startup-id nm-applet/exec --no-startup-id nm-applet/' ~/.config/i3/config
32+
if [[ $nmicon = y ]]; then
33+
sed -i "s/#exec --no-startup-id nm-applet/exec --no-startup-id nm-applet/" ~/.config/i3/config
3634
echo '设置成功,请确保你安装了nm-applet'
3735
fi
3836

39-
echo -e '\e[1;33m================\e[0m'
37+
draw_line
38+
4039
read -p '你使用xcompmgr合成器(用以使终端背景透明)吗?输入y或者n:' xcomp
4140

42-
if [ $xcomp = y ]
43-
then
44-
sed -i 's/#exec --no-startup-id xcompmgr &/exec --no-startup-id xcompmgr &/' ~/.config/i3/config
41+
if [[ $xcomp = y ]]; then
42+
sed -i "s/#exec --no-startup-id xcompmgr &/exec --no-startup-id xcompmgr &/" ~/.config/i3/config
4543
echo '设置成功,请确保你安装了xcompmgr'
4644
fi
4745

48-
echo -e '\e[1;33m================\e[0m'
49-
read -p '你使用mate-power-manager?输入y或者n:' matepower
46+
draw_line
47+
48+
read -p "你使用mate-power-manager?输入y或者n:" matepower
5049

51-
if [ $matepower = y ]
52-
then
53-
sed -i 's/#exec --no-startup-id mate-power-manager/exec --no-startup-id mate-power-manager/' ~/.config/i3/config
50+
if [[ $matepower = y ]]; then
51+
sed -i "s/#exec --no-startup-id mate-power-manager/exec --no-startup-id mate-power-manager/" ~/.config/i3/config
5452
echo '设置成功,请确保你已经安装了mate-power-manager'
5553
fi
5654

57-
echo -e '\e[1;33m================\e[0m'
55+
draw_line
56+
5857
echo '配置完成。更多配置参考README.md'

config.sh

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/sh
2+
tar -xJvf Pictures.tar.xz -C ~/
3+
cp -av i3 ~/.config
4+
chmod +x *.sh -R
5+
6+
lang=
7+
8+
function select_lang() {
9+
while :; do
10+
echo "which language to use during installation?"
11+
echo -en "
12+
Input the Number you select.
13+
14+
$(tput bold)1$(tput sgr0) English
15+
$(tput bold)2$(tput sgr0) Chinese
16+
"
17+
read select_num
18+
case $select_num in
19+
'1')
20+
lang='en'
21+
break
22+
;;
23+
'2')
24+
lang='zh'
25+
break
26+
;;
27+
*)
28+
continue
29+
;;
30+
esac
31+
done
32+
}
33+
34+
select_lang
35+
36+
function draw_line() {
37+
[[ -z $1 ]] && str="-" || str=$1
38+
seq -s "$str" $COLUMNS | sed "s/[0-9]//g"
39+
}
40+
source ./config-${lang}.sh

0 commit comments

Comments
 (0)