dotfiles/i3/config
2019-08-09 22:56:06 +08:00

272 lines
8.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
set_from_resource $bg background #0c080b
set_from_resource $fg foreground #e5e3e3
set_from_resource $color_2 color2 #d09177
set_from_resource $color_4 color4 #b5659a
set_from_resource $color_6 color6 #aea0c7
set_from_resource $color_16 color16 #ffffff
set $pictures_directory '~/Pictures'
exec_always feh --bg-scale ~/wallpapers/nebula.jpg
# Startup applications
exec firefox
exec thunderbird
exec thunar
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:monospace 10
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
font pango:Fira Code 10
# Setting up borders for windows of different states
default_border pixel 10
# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesnt scale on retina/hidpi displays.
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec i3-sensible-terminal
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
bindsym $mod+d exec rofi -show drun -sidebar-mode -theme fds-sidebar-dark
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+semicolon move right
# alternatively, you can use the cursor 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
# split in horizontal orientation
bindsym $mod+b split h
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# jump to latest urgent window
bindsym $mod+x [urgent=latest] focus
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
#bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+d focus child
# Volume keyboard control
bindsym XF86AudioRaiseVolume exec amixer -q sset Master 1+ unmute
bindsym XF86AudioLowerVolume exec amixer -q sset Master 1- unmute
bindsym XF86AudioMute exec amixer -q sset Master mute
# Moving between workspaces
bindsym XF86Back workspace prev
bindsym XF86Forward workspace next
bindsym $mod+Tab workspace next
bindsym Shift+$mod+Tab workspace prev
bindsym $mod+z move window to workspace next
bindsym Shift+$mod+z move window to workspace prev
# Alt + ` (backtick)
bindsym $mod+grave workspace back_and_forth
bindsym Shift+$mod+grave move window to workspace back_and_forth
# Application bound shortcuts
bindsym XF86HomePage exec kitty --class "ranger" ranger
bindsym XF86Mail exec thunderbird
bindsym Print exec scrot '%F-%H-%M-%S-$wx$h.png' -e 'mv $f ~/Pictures'
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $web_ws "1"
set $mail_ws "2"
set $code_ws "3"
set $vim_ws "4"
set $graphics_ws "5"
set $file_ws "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
# automatic back-and-forth switching with $mod+<num>
workspace_auto_back_and_forth yes
assign [class="^(?i)code-oss$"] $code_ws
assign [class="^(?i)vim$"] $vim_ws
assign [class="^(?i)ranger"] $file_ws
assign [class="^(?i)thunar"] $file_ws
assign [class="^(?i)firefox$"] $web_ws
assign [class="^(?i)inkscape$"] $graphics_ws
assign [class="^(?i)thunderbird$"] $mail_ws
assign [class="^(?i)zathura$"] $w7
# switch to workspace
bindsym $mod+1 workspace $web_ws
bindsym $mod+2 workspace $mail_ws
bindsym $mod+3 workspace $code_ws
bindsym $mod+4 workspace $vim_ws
bindsym $mod+5 workspace $graphics_ws
bindsym $mod+6 workspace $file_ws
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
bindsym $mod+9 workspace $ws9
bindsym $mod+0 workspace $ws10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $web_ws
bindsym $mod+Shift+2 move container to workspace $mail_ws
bindsym $mod+Shift+3 move container to workspace $code_ws
bindsym $mod+Shift+4 move container to workspace $vim_ws
bindsym $mod+Shift+5 move container to workspace $graphics_ws
bindsym $mod+Shift+6 move container to workspace $file_ws
bindsym $mod+Shift+7 move container to workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9
bindsym $mod+Shift+0 move container to workspace $ws10
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade 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'"
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym h resize shrink width 10 px or 10 ppt
bindsym j resize grow height 10 px or 10 ppt
bindsym k resize shrink height 10 px or 10 ppt
bindsym l resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"
# Make dialogs to float by default
for_window [window_role="pop-up"] floating enable
for_window [window_role="task_dialog"] floating enable
# This is mostly for limiting pop-up dialogs
floating_maximum_size 750 x 650
mode "applications" {
# Here you can add/remove/modify applications of your own, if you want
bindsym c exec code
bindsym f exec firefox
bindsym v exec inkscape
bindsym r exec kitty --class "ranger" ranger
bindsym t exec thunderbird
bindsym a exec thunar
bindsym x exec kitty --class "vim" vim
bindsym z exec zathura
# Ways to exit the mode
bindsym Escape mode "default"
bindsym Return mode "default"
bindsym $mod+a mode "default"
}
bindsym $mod+a mode "applications"; exec sleep 1 && i3-msg mode "default"
# i3 bar
bar {
height 35
font pango:Noto Sans 11
position top
separator_symbol " "
status_command i3status
tray_padding 10
colors {
separator $color_16
background $bg
statusline $fg
# border #background #foreground
focused_workspace $color_2 $color_2 #ffffff
active_workspace $color_4 $color_4 #ffffff
inactive_workspace $bg $bg #888888
urgent_workspace $color_4 $color_4 #ffffff
}
}
# Setting the gaps
gaps inner 10
smart_gaps on
smart_borders on