├── README.md ├── config └── screenshot.png /README.md: -------------------------------------------------------------------------------- 1 | # i3wm 的配置文件 2 | 3 | ![screenshot](screenshot.png) 4 | -------------------------------------------------------------------------------- /config: -------------------------------------------------------------------------------- 1 | # i3 config file (v4) 2 | # 3 | # Please see https://i3wm.org/docs/userguide.html for a complete reference! 4 | 5 | # This file has been auto-generated by i3-config-wizard(1). 6 | # It will not be overwritten, so edit it as you like. 7 | # 8 | # Should you change your keyboard layout some time, delete 9 | # this file and re-run i3-config-wizard(1). 10 | # 11 | #窗口边框 12 | default_border pixel 1 13 | 14 | # 单窗口无边框 15 | # Smart borders (draw borders around container only if it is not the only container on this workspace) 16 | # on|no_gaps (on=always activate and no_gaps=only activate if the gap size to the edge of the screen is 0) 17 | smart_borders no_gaps 18 | 19 | #窗口间缝隙 20 | gaps inner 2 21 | 22 | #窗口外边距 23 | gaps outer 1 24 | 25 | #启动polybar脚本,第一次要加可执行权限 (chmod+x) 26 | exec_always --no-startup-id ~/.config/polybar/useBarA.sh 27 | 28 | #窗口渲染器 29 | exec_always --no-startup-id picom -b 30 | 31 | #壁纸 32 | exec --no-startup-id variety 33 | 34 | #中文输入法 35 | exec --no-startup-id fcitx5 36 | 37 | #设置mod为Win键 38 | set $mod Mod4 39 | 40 | #设置mod1为alt键 41 | set $mod1 Mod1 42 | 43 | # Font for window titles. Will also be used by the bar unless a different font 44 | # is used in the bar {} block below. 45 | font pango:ttf-liberation-mono 14 46 | 47 | # This font is widely installed, provides lots of unicode glyphs, right-to-left 48 | # text rendering and scalability on retina/hidpi displays (thanks to pango). 49 | #font pango:DejaVu Sans Mono 8 50 | 51 | # The combination of xss-lock, nm-applet and pactl is a popular choice, so 52 | # they are included here as an example. Modify as you see fit. 53 | 54 | # xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the 55 | # screen before suspend. Use loginctl lock-session to lock your screen. 56 | # exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork 57 | 58 | # NetworkManager is the most popular way to manage wireless networks on Linux, 59 | # and nm-applet is a desktop environment-independent system tray GUI for it. 60 | exec --no-startup-id nm-applet 61 | 62 | # Use pactl to adjust volume in PulseAudio. 63 | # set $refresh_i3status killall -SIGUSR1 i3status 64 | # bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status 65 | # bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status 66 | # bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status 67 | # bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status 68 | 69 | # Use Mouse+$mod to drag floating windows to their wanted position 70 | floating_modifier $mod 71 | 72 | # alacritty terminal 73 | bindsym $mod+Return exec --no-startup-id alacritty;split toggle;focus 74 | # st (simple terminal) 75 | bindsym $mod1+Return exec --no-startup-id st;split toggle;focus 76 | for_window [class="st"] floating enable resize set 1480 640,move right -220px,move down -20px 77 | 78 | # 用 alacritty 启动ranger文件管理器 79 | bindsym $mod+n exec alacritty -e ranger;split toggle;focus 80 | bindsym $mod+shift+n exec alacritty -e sudo ranger;split toggle;focus 81 | 82 | # 用st启动ranger文件管理器 83 | bindsym $mod1+n exec st -e ranger;split toggle;focus 84 | bindsym $mod1+shift+n exec st -e sudo ranger;split toggle;focus 85 | 86 | # google-chrome浏览器 87 | bindsym ctrl+shift+m exec --no-startup-id google-chrome-stable 88 | 89 | # i3lock-fancy锁屏 90 | bindsym ctrl+$mod+l exec --no-startup-id i3lock-fancy 91 | 92 | bindsym ctrl+$mod+u exec qvidcap 93 | for_window [class="qvidcap"] floating enable 94 | 95 | # 网易云音乐 96 | bindsym $mod+u exec --no-startup-id netease-cloud-music 97 | 98 | # 把网易云默认安排到第 8 个桌面, 8 在 u 上面,直接 $mod+u,8 一气呵成 99 | assign [class="netease-cloud-music"] $ws8 100 | 101 | # 文件管理器 pcmanfm ,挺好用, $mod+e 和 layout toggle 冲突,改用 $mod1+e 102 | # bindsym $mod1+e exec --no-startup-id dolphin 103 | # bindsym $mod1+e exec --no-startup-id nautilus 104 | bindsym $mod1+e exec --no-startup-id pcmanfm 105 | 106 | # flameshot 截图工具 107 | bindsym $mod+shift+s exec --no-startup-id flameshot gui 108 | 109 | # KDE的系统设置,因为我预装的KDE,设置蓝牙WIFI挺方便的,就懒得每次敲命令连网了 (山顶洞人操作) 110 | bindsym ctrl+shift+k exec --no-startup-id systemsettings 111 | 112 | # 类似于 start menu 的一个东西 113 | bindsym $mod+o exec --no-startup-id rofi -show drun -show-icons 114 | 115 | # kill focused window 116 | bindsym $mod+q kill 117 | 118 | # start dmenu (a program launcher) 119 | bindsym $mod+d exec --no-startup-id dmenu_run 120 | 121 | # There also is the (new) i3-dmenu-desktop which only displays applications 122 | # shipping a .desktop file. It is a wrapper around dmenu, so you need that 123 | # installed. 124 | bindsym $mod+b exec --no-startup-id i3-dmenu-desktop 125 | # change focus 126 | bindsym $mod+j focus down 127 | bindsym $mod+k focus up 128 | bindsym $mod+l focus left 129 | bindsym $mod+semicolon focus right 130 | 131 | # alternatively, you can use the cursor keys: 132 | bindsym $mod+Left focus left 133 | bindsym $mod+Down focus down 134 | bindsym $mod+Up focus up 135 | bindsym $mod+Right focus right 136 | 137 | # move focused window 138 | # k 139 | # h l 140 | # j 141 | bindsym $mod+Shift+h move left 142 | bindsym $mod+Shift+j move down 143 | bindsym $mod+Shift+k move up 144 | bindsym $mod+Shift+l move right 145 | # bindsym $mod+Shift+semicolon move right 146 | 147 | # alternatively, you can use the cursor keys: 148 | bindsym $mod+Shift+Left move left 149 | bindsym $mod+Shift+Down move down 150 | bindsym $mod+Shift+Up move up 151 | bindsym $mod+Shift+Right move right 152 | 153 | # orientation for new workspaces 154 | default_orientation horizontal 155 | 156 | # split in horizontal orientation 157 | bindsym $mod+h split h 158 | 159 | # split in vertical orientation 160 | bindsym $mod+v split v 161 | 162 | # enter fullscreen mode for the focused container 163 | bindsym $mod+f fullscreen toggle 164 | 165 | # change container layout (stacked, tabbed, toggle split) 166 | bindsym $mod+s layout stacking 167 | bindsym $mod+w layout tabbed 168 | bindsym $mod+e layout toggle split 169 | 170 | # toggle tiling / floating 171 | bindsym $mod+Shift+space floating toggle 172 | 173 | # change focus between tiling / floating windows 174 | bindsym $mod+space focus mode_toggle 175 | 176 | # focus the parent container 177 | bindsym $mod+a focus parent 178 | 179 | # focus the child container 180 | #bindsym $mod+d focus child 181 | 182 | # Define names for default workspaces for which we configure key bindings later on. 183 | # We use variables to avoid repeating the names in multiple places. 184 | set $ws1 "1" 185 | set $ws2 "2" 186 | set $ws3 "3" 187 | set $ws4 "4" 188 | set $ws5 "5" 189 | set $ws6 "6" 190 | set $ws7 "7" 191 | set $ws8 "8" 192 | set $ws9 "9" 193 | set $ws10 "10" 194 | 195 | # switch to workspace 196 | bindsym $mod+1 workspace number $ws1 197 | bindsym $mod+2 workspace number $ws2 198 | bindsym $mod+3 workspace number $ws3 199 | bindsym $mod+4 workspace number $ws4 200 | bindsym $mod+5 workspace number $ws5 201 | bindsym $mod+6 workspace number $ws6 202 | bindsym $mod+7 workspace number $ws7 203 | bindsym $mod+8 workspace number $ws8 204 | bindsym $mod+9 workspace number $ws9 205 | bindsym $mod+0 workspace number $ws10 206 | 207 | # move focused container to workspace 208 | bindsym $mod+Shift+1 move container to workspace number $ws1 209 | bindsym $mod+Shift+2 move container to workspace number $ws2 210 | bindsym $mod+Shift+3 move container to workspace number $ws3 211 | bindsym $mod+Shift+4 move container to workspace number $ws4 212 | bindsym $mod+Shift+5 move container to workspace number $ws5 213 | bindsym $mod+Shift+6 move container to workspace number $ws6 214 | bindsym $mod+Shift+7 move container to workspace number $ws7 215 | bindsym $mod+Shift+8 move container to workspace number $ws8 216 | bindsym $mod+Shift+9 move container to workspace number $ws9 217 | bindsym $mod+Shift+0 move container to workspace number $ws10 218 | 219 | # reload the configuration file 220 | bindsym $mod+Shift+c reload 221 | # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) 222 | bindsym $mod+Shift+r restart 223 | # exit i3 (logs you out of your X session) 224 | 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'" 225 | 226 | # exit i3 without any msg 227 | bindsym $mod1+Shift+e exec "i3-msg exit" 228 | 229 | # 调整亮度( alt 1~0, 非常方便哈哈) 230 | # 你可以在终端输入 xrandr --output 然后按 tab 查看你接的哪个显示器 231 | # 默认可能是 eDP-1 232 | # 相应处更改 233 | bindsym $mod1+1 exec "xrandr --output eDP1 --brightness 0.1" 234 | bindsym $mod1+2 exec "xrandr --output eDP1 --brightness 0.2" 235 | bindsym $mod1+3 exec "xrandr --output eDP1 --brightness 0.3" 236 | bindsym $mod1+4 exec "xrandr --output eDP1 --brightness 0.4" 237 | bindsym $mod1+5 exec "xrandr --output eDP1 --brightness 0.5" 238 | bindsym $mod1+6 exec "xrandr --output eDP1 --brightness 0.6" 239 | bindsym $mod1+7 exec "xrandr --output eDP1 --brightness 0.7" 240 | bindsym $mod1+8 exec "xrandr --output eDP1 --brightness 0.8" 241 | bindsym $mod1+9 exec "xrandr --output eDP1 --brightness 0.9" 242 | bindsym $mod1+0 exec "xrandr --output eDP1 --brightness 1.0" 243 | 244 | # resize window (you can also use the mouse for that) 245 | mode "resize" { 246 | # These bindings trigger as soon as you enter the resize mode 247 | 248 | # Pressing left will shrink the window’s width. 249 | # Pressing right will grow the window’s width. 250 | # Pressing up will shrink the window’s height. 251 | # Pressing down will grow the window’s height. 252 | bindsym j resize shrink width 10 px or 10 ppt 253 | bindsym k resize grow height 10 px or 10 ppt 254 | bindsym l resize shrink height 10 px or 10 ppt 255 | bindsym semicolon resize grow width 10 px or 10 ppt 256 | 257 | # same bindings, but for the arrow keys 258 | bindsym Left resize shrink width 10 px or 10 ppt 259 | bindsym Down resize grow height 10 px or 10 ppt 260 | bindsym Up resize shrink height 10 px or 10 ppt 261 | bindsym Right resize grow width 10 px or 10 ppt 262 | 263 | # back to normal: Enter or Escape or $mod+r 264 | bindsym Return mode "default" 265 | bindsym Escape mode "default" 266 | bindsym $mod+r mode "default" 267 | } 268 | 269 | bindsym $mod+r mode "resize" 270 | 271 | 272 | 273 | # i3-gaps 274 | for_window [class="^.*"] border pixel 1 275 | set $mode_gaps Gaps: (o) outer, (i) inner 276 | set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global) 277 | set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global) 278 | bindsym $mod+Shift+g mode "$mode_gaps" 279 | bindsym $mod+Shift+i mode "$mode_gaps_inner" 280 | bindsym $mod+Shift+o mode "$mode_gaps_outer" 281 | 282 | # reset i3 gaps 283 | bindsym ctrl+Shift+0 gaps inner current set 2;gaps outer current set 0 284 | 285 | mode "$mode_gaps" { 286 | bindsym o mode "$mode_gaps_outer" 287 | bindsym i mode "$mode_gaps_inner" 288 | bindsym Return mode "default" 289 | bindsym Escape mode "default" 290 | } 291 | 292 | mode "$mode_gaps_inner" { 293 | bindsym plus gaps inner current plus 8 294 | bindsym minus gaps inner current minus 8 295 | bindsym 0 gaps inner current set 2 296 | 297 | bindsym Shift+plus gaps inner all plus 8 298 | bindsym Shift+minus gaps inner all minus 8 299 | bindsym Shift+0 gaps inner all set 0 300 | 301 | bindsym Return mode "default" 302 | bindsym Escape mode "default" 303 | } 304 | mode "$mode_gaps_outer" { 305 | bindsym plus gaps outer current plus 8 306 | bindsym minus gaps outer current minus 8 307 | bindsym 0 gaps outer current set 0 308 | 309 | bindsym Shift+plus gaps outer all plus 8 310 | bindsym Shift+minus gaps outer all minus 8 311 | bindsym Shift+0 gaps outer all set 0 312 | 313 | bindsym Return mode "default" 314 | bindsym Escape mode "default" 315 | } 316 | 317 | # Start Theming wm 318 | # Theme name : Arcolinux Default 319 | # 320 | # Window color settings 321 | # class border backgr. text indicator 322 | client.focused #6790EB #6790EB #e5e5e5 #6790EB 323 | client.unfocused #222222 #222222 #aaaaaa #222222 324 | client.focused_inactive #222222 #222222 #a9a9a9 #222222 325 | client.placeholder #222222 #222222 #aaaaaa #222222 326 | client.urgent #d42121 #d42121 #f7f7f7 #d42121 327 | client.background #242424 328 | 329 | # End Theming wm 330 | 331 | # Start i3bar to display a workspace bar (plus the system information i3status 332 | # finds out, if available) 333 | # bar { 334 | # status_command i3status 335 | # position bottom 336 | # colors { 337 | # background #2F2F2F 338 | # statusline #eeeeee 339 | # separator #666666 340 | # 341 | # # colorclass border backgr. text 342 | # focused_workspace #a9a9a9 #5f676a #eeeeee 343 | # active_workspace #a9a9a9 #5f676a #a9a9a9 344 | # inactive_workspace #a9a9a9 #5f676a #a9a9a9 345 | # urgent_workspace #a9a9a9 #e82951 #FFFFFF 346 | # } 347 | # } 348 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehhr/i3/2e1ff23819c568496e8000c79c187c75fd96939a/screenshot.png --------------------------------------------------------------------------------