dotfiles/.config/i3/config

269 lines
7.5 KiB
Plaintext
Raw Permalink Normal View History

2022-01-18 09:17:36 +08:00
### Variables
#
# Colors
2022-01-18 18:39:26 +08:00
set $base03 #002b36
set $base02 #073642
set $base01 #586e75
set $base00 #657b83
set $base0 #839496
set $base1 #93a1a1
set $base2 #eee8d5
set $base3 #fdf6e3
set $yellow #b58900
set $orange #cb4b16
set $red #dc322f
set $magenta #d33682
set $violet #6c71c4
set $blue #268bd2
set $cyan #2aa198
set $green #859900
2022-01-21 10:08:34 +08:00
# Font
set $font SourceCodePro Semibold 11px
2022-01-18 09:17:36 +08:00
# Logo key. Use Mod1 for Alt.
set $mod Mod4
# Home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l
# Your preferred terminal emulator
set $term alacritty
# Your preferred application launcher
set $menu "rofi -modi drun,run -show drun"
2022-01-24 05:16:59 +08:00
# Window switcher
2022-01-18 09:17:36 +08:00
set $search "rofi -modi window -show window"
2022-01-24 05:16:59 +08:00
# Screenshot
2022-06-26 07:50:56 +08:00
set $screenshot "~/.config/scripts/wm/screenshot.sh"
2022-01-18 09:17:36 +08:00
set $mon1 DisplayPort-1
set $mon2 HDMI-A-2
2022-01-18 09:17:36 +08:00
### Key bindings
#
# Basics:
#
# Start a terminal
bindsym $mod+Return exec $term
# Kill focused window
bindsym $mod+w kill
# Start your launcher
bindsym $mod+space exec $menu
2022-01-24 05:19:01 +08:00
# Screenshot
2022-01-24 05:16:59 +08:00
bindsym $mod+q exec $screenshot
2022-01-20 02:50:12 +08:00
2022-01-18 09:17:36 +08:00
# Search window
bindsym $mod+e exec $search
# Drag floating windows by holding down $mod and left mouse button.
# Resize them with right mouse button + $mod.
# Despite the name, also works for non-floating windows.
# Change normal to inverse to use left mouse button for resizing and right
# mouse button for dragging.
floating_modifier $mod
# Reload the configuration file
bindsym $mod+Control+r reload
# Exit i3 (logs you out of your Xorg session)
bindsym $mod+Control+q exec i3-msg exit
# Lock i3
bindsym $mod+Escape exec i3lock -f -c 000000
2022-03-24 22:28:53 +08:00
bindsym $mod+Shift+Escape exec i3lock -f -c 000000 & sleep 2 ; exec systemctl suspend
2022-01-18 09:17:36 +08:00
#
# Moving around:
#
# Move your focus around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# Or use $mod+[up|down|left|right]
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# Move the focused window with the same, but add Shift
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
# Ditto, with arrow keys
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
#
# Workspaces:
#
# Switch to workspace
bindsym $mod+a workspace number 1:a
bindsym $mod+r workspace number 2:r
bindsym $mod+s workspace number 3:s
bindsym $mod+t workspace number 4:t
bindsym $mod+z workspace number 5:z
bindsym $mod+x workspace number 6:x
bindsym $mod+c workspace number 7:c
bindsym $mod+v workspace number 8:v
# Move focused container to workspace
bindsym $mod+Shift+a move container to workspace number 1:a
bindsym $mod+Shift+r move container to workspace number 2:r
bindsym $mod+Shift+s move container to workspace number 3:s
bindsym $mod+Shift+t move container to workspace number 4:t
bindsym $mod+Shift+z move container to workspace number 5:z
bindsym $mod+Shift+x move container to workspace number 6:x
bindsym $mod+Shift+c move container to workspace number 7:c
bindsym $mod+Shift+v move container to workspace number 8:v
# Note: workspaces cran have any name you want, not just numbers.
# We just use 1-10 as the default.
# bind workspaces to monitor
workspace 1:a output $mon1
workspace 2:r output $mon1
workspace 3:s output $mon1
workspace 4:t output $mon1
workspace 5:z output $mon2
workspace 6:x output $mon2
workspace 7:c output $mon2
workspace 8:v output $mon2
#
#
# Monitors:
#
bindsym $mod+comma focus output left
bindsym $mod+period focus output right
bindsym $mod+shift+comma move workspace to output left
bindsym $mod+shift+period move workspace to output right
#
# Layout stuff:
#
# You can "split" the current object of your focus with
# $mod+b or $mod+v, for horizontal and vertical splits
# respectively.
bindsym $mod+d splith
bindsym $mod+b splitv
# Switch the current container between different layout styles
bindsym $mod+u layout stacking
bindsym $mod+y layout tabbed
bindsym $mod+n layout toggle split
# Make the current focus fullscreen
bindsym $mod+f fullscreen
#bindsym $mod+shift+f floating enable ; resize set height 98 ppt ; resize set width 60 ppt ; move container position center
# Toggle the current focus between tiling and floating mode
bindsym $mod+Control+space floating toggle
# Swap focus between the tiling area and the floating area
bindsym $mod+m focus mode_toggle
# Move focus to the parent container
bindsym $mod+p focus parent
bindsym $mod+shift+p focus child
#
# Scratchpad:
#
# Sway has a "scratchpad", which is a bag of holding for windows.
# You can send windows there and get them back later.
# Move the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+minus scratchpad show
#
# Resizing containers:
#
mode "resize" {
# left will shrink the containers width
# right will grow the containers width
# up will shrink the containers height
# down will grow the containers height
2022-03-24 22:28:53 +08:00
bindsym $left resize shrink width 20px
bindsym $down resize grow height 20px
bindsym $up resize shrink height 20px
bindsym $right resize grow width 20px
2022-01-18 09:17:36 +08:00
# Ditto, with arrow keys
2022-03-24 22:28:53 +08:00
bindsym Left resize shrink width 20px
bindsym Down resize grow height 20px
bindsym Up resize shrink height 20px
bindsym Right resize grow width 20px
2022-01-18 09:17:36 +08:00
# Return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
2022-03-24 22:28:53 +08:00
bindsym $mod+Shift+Return mode "resize"
2022-01-18 09:17:36 +08:00
mode "gaming" {
bindsym $mod+g mode "default"
}
bindsym $mod+g mode "gaming"
#
# Status Bar:
#
2022-01-21 10:08:34 +08:00
font pango:$font
2022-01-18 09:17:36 +08:00
bar {
position top
# When the status_command prints a new line to stdout, swaybar updates.
# The default just shows the current date and time.
status_command slstatus -s
colors {
2022-01-18 18:39:26 +08:00
background $base03
statusline $base0
separator $base0
focused_workspace $orange $base02 $cyan
2022-01-20 02:50:12 +08:00
active_workspace $base02 $base03 $base0
2022-01-18 18:39:26 +08:00
inactive_workspace $base02 $base03 $base0
urgent_workspace $cyan $red $base03
2022-01-18 09:17:36 +08:00
}
2022-01-21 10:08:34 +08:00
font pango:$font
2022-01-18 09:17:36 +08:00
tray_output primary
}
2022-01-18 18:39:26 +08:00
#
# Window Colors:
#
client.focused $base01 $green $base03 $blue $cyan
client.focused_inactive $base0 $base02 $base0 $blue $base0
client.unfocused $base01 $base03 $base01 $blue $base01
client.urgent $base03 $red $base0 $red $red
client.placeholder #000000 $base01 $base0 #000000 $base01
client.background $base03
bindsym $mod+Control+h gaps horizontal current plus 100
bindsym $mod+Control+l gaps horizontal current minus 100
2022-03-24 22:28:53 +08:00
bindsym $mod+Shift+f gaps horizontal current toggle 400
2022-01-18 09:17:36 +08:00
smart_gaps inverse_outer
default_border pixel 3
### Startup Applications:
exec alacritty
exec firefox
2022-03-24 22:28:53 +08:00
exec flatpak run com.discordapp.Discord
2022-01-18 09:17:36 +08:00
assign [class="firefox"] 2:r
2022-01-18 09:17:36 +08:00
assign [class="discord"] 3:s
assign [class="Steam"] 4:t
2022-02-18 11:45:47 +08:00
assign [class="zoom"] 8:v
2022-01-18 09:17:36 +08:00
exec --no-startup-id fcitx5 -d
exec --no-startup-id dunst
2022-06-26 07:50:56 +08:00
exec ~/.config/scripts/wm/autostart.sh