更新i3配置

i3
yutent 2023-06-29 07:04:09 +00:00
parent 71388fabed
commit a5aa8ebb31
2 changed files with 140 additions and 36 deletions

View File

@ -1,13 +1,120 @@
# i3 配置
# 设置主键为Super键
set $mod Mod4
set $alt Mod1
# 字体
font pango:monospace 8
# 窗口间隔
gaps inner 8
# 浮动窗口的 最大&最小尺寸
floating_maximum_size 1280 x 768
floating_minimum_size 640 x 480
# 终端默认以浮动形式打开
for_window [class="Alacritty"] floating enable
# 设置浮动窗口有标题栏, 平铺窗口没有 (有点bug, 标题栏去掉之后, 恢复不回来, 下面加了一组快捷键恢复标题栏)
for_window [floating] border inormal
for_window [tiling] border none
# Start XDG autostart .desktop files using dex. See also
# https://wiki.archlinux.org/index.php/XDG_Autostart
exec --no-startup-id dex --autostart --environment i3
# The combination of xss-lock, nm-applet and pactl is a popular choice, so
# they are included here as an example. Modify as you see fit.
# 设置睡眠时自动锁屏
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
exec --no-startup-id picom --experimental-backend
# NetworkManager is the most popular way to manage wireless networks on Linux,
# and nm-applet is a desktop environment-independent system tray GUI for it.
exec --no-startup-id feh --bg-fill ~/.local/share/debian.png
# 启动网络管理器 tray
exec --no-startup-id nm-applet
# 启动polybar
exec --no-startup-id ~/.config/polybar/launch.sh
# 设置桌面背景
exec --no-startup-id feh --bg-fill /data/debian.png
# Use pactl to adjust volume in PulseAudio.
set $refresh_i3status killall -SIGUSR1 i3status
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
# 拖拽窗口的按键, 默认为 $mod
floating_modifier $mod
# 注释之后, 按住主键, 即可用鼠标拖拽移动窗口。 取消注释, 则只有标题栏才能拖拽窗口
#tiling_drag modifier titlebar
# 绑定终端启动的快捷键
bindsym $alt+Ctrl+t exec i3-sensible-terminal
# 绑定关闭窗口的快捷键
bindsym $mod+q kill
# 绑定2种不同形式的rofi的快捷键
bindsym $mod+d exec --no-startup-id rofi -show drun
bindsym $alt+Tab exec --no-startup-id rofi -show windowcd
# flameshot 截图的快捷键
bindsym Ctrl+$alt+a exec --no-startup-id flameshot gui
bindsym Ctrl+$alt+Shift+a exec --no-startup-id flameshot gui -d 2000
# 绑定切换窗口布局的快捷键, 在堆叠和平铺中切换
bindsym $mod+F9 layout toggle stacking split
# 显示窗口的标题栏, 用来解决上面提到的bug
bindsym $mod+Shift+Insert border normal
# 来回将当前窗口改为平铺或浮动
bindsym $mod+Shift+space floating toggle
# 设置下个平铺窗口的拆分方向, 横向, backslash为反斜杠键
bindsym $mod+$alt+backslash split h
# 同上, 此为纵向, equal 即为"等号键"
bindsym $mod+$alt+equal split v
# 来回切换全屏
bindsym F11 fullscreen toggle
# 设置工作区名称
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
# 切换工作区的快捷键
bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym Ctrl+Tab workspace next
bindsym Ctrl+Shift+Tab workspace prev
# 移动窗口到指定工作区
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
# 重新加载i3配置文件
bindsym $mod+Shift+c reload
# 重启i3
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
#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'"

View File

@ -33,8 +33,8 @@ mpadding = 1
margin = 3
[bar/main]
override-redirect = true
wm-restack = i3
;override-redirect = true
owm-restack = i3
locale = zh_CN.UTF-8
@ -42,17 +42,21 @@ background = ${colors.xbg}
foreground = ${colors.xfg}
width = 98%
height = 36
width = 100%
height = 30
padding-left = 2
padding-right = 4
border-top-size = 5
border-bottom-size = 5
border-top-color = ${colors.xbg}
border-bottom-color = ${colors.xbg}
padding-left = 0
padding-right = 2
offset-x = 1%
offset-y = 12
offset-x = 0
offset-y = 0
radius = 18
;radius = 18
font-0 = "HarmonyOS Sans SC:size=11;3"
@ -62,7 +66,7 @@ font-2 = "DejaVu Sans:size=16;4"
fixed-center = true
modules-left = logo ws
modules-left = logo i3
modules-center = date
modules-right = netspeed space space hibernate space logout
@ -82,34 +86,27 @@ enable-ipc = true
type = custom/text
content =
content-foreground = ${colors.red}
content-padding = 2
content-padding = 4
[module/ws]
type = internal/xworkspaces
[module/i3]
type = internal/i3
icon-0 = "Workspace 1;➊"
icon-1 = "Workspace 2;➋"
icon-2 = "Workspace 3;➌"
icon-default = "➓"
enable-click = false
index-sort = true
label-focused = %index%
label-focused-background = ${colors.orange}
label-focused-padding = 3
label-active = %icon%
label-active-foreground = ${colors.orange}
label-active-padding = 2
label-unfocused = %index%
label-unfocused-padding = 3
label-unfocused-foreground = ${colors.color4}
label-urgent = %icon%
label-urgent-padding = 2
label-urgent-foreground = ${colors.color4}
label-occupied = %icon%
label-occupied-padding = 2
label-occupied-foreground = ${colors.color4}
label-empty = %icon%
label-empty-padding = 2
label-empty-foreground = ${colors.color4}
label-visible= %index%
label-visible-padding = 3
label-visible-foreground = ${colors.color4}
[module/date]
@ -119,7 +116,7 @@ date = "%m月%d %A"
time = "%k:%M"
label = %date% %time%
label-font = 1
#click-left = alacritty -e "/usr/bin/cal"
[module/netspeed]
@ -149,4 +146,4 @@ content-padding = 2
[module/space]
type = custom/text
content = %{T1} %{T-}
content = %{T1} %{T-}