rusty1s/dotfiles

View on GitHub
i3/config

Summary

Maintainability
Test Coverage
# vi: set ft=config :

set $mod Mod1

font pango:SFUI Text Nerd Font 12

new_window pixel 2
gaps inner 10

# Use Mouse+$mod to drag floating windows to their wanted position.
floating_modifier $mod

# Start a terminal.
bindsym $mod+Return exec alacritty

# Kill focused window.
bindsym $mod+q kill

# Start program launcher.
bindsym $mod+d exec ~/dotfiles/i3/rofi.sh

# Change focus.
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right

# Move focused window.
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right

# Split in horizontal orientation.
bindsym $mod+backslash split h

# Split in vertical orientation.
bindsym $mod+minus split v

# Enter fullscreen mode for the focused container.
bindsym $mod+f fullscreen toggle

# 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

set $workspace1 "1: "
set $workspace2 "2: "
set $workspace3 "3: "
set $workspace4 "4"
set $workspace5 "5"
set $workspace6 "6"
set $workspace7 "7"
set $workspace8 "8"
set $workspace9 "9: "
set $workspace10 "10: "

# Switch to workspace.
bindsym $mod+1 workspace $workspace1
bindsym $mod+2 workspace $workspace2
bindsym $mod+3 workspace $workspace3
bindsym $mod+4 workspace $workspace4
bindsym $mod+5 workspace $workspace5
bindsym $mod+6 workspace $workspace6
bindsym $mod+7 workspace $workspace7
bindsym $mod+8 workspace $workspace8
bindsym $mod+9 workspace $workspace9
bindsym $mod+0 workspace $workspace10

# Move focused container to workspace.
bindsym $mod+Shift+1 move container to workspace $workspace1
bindsym $mod+Shift+2 move container to workspace $workspace2
bindsym $mod+Shift+3 move container to workspace $workspace3
bindsym $mod+Shift+4 move container to workspace $workspace4
bindsym $mod+Shift+5 move container to workspace $workspace5
bindsym $mod+Shift+6 move container to workspace $workspace6
bindsym $mod+Shift+7 move container to workspace $workspace7
bindsym $mod+Shift+8 move container to workspace $workspace8
bindsym $mod+Shift+9 move container to workspace $workspace9
bindsym $mod+Shift+0 move container to workspace $workspace10

# Assign applications to specific workspaces.
assign [class="whats-app-nativefier-7bbd2c"] $workspace9
# Spotify has a bug where it can't be assigned to a workspace, so we create the
# window in the current workspace and move it afterwards.
for_window [class="Spotify"] move to workspace $workspace10

# 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 exit

# Resize window (you can also use the mouse for that).
mode "resize" {
  # These bindings trigger as soon as you enter the resize mode.
  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

  # Back to normal: Enter or Escape.
  bindsym Return mode "default"
  bindsym Escape mode "default"
}

bindsym $mod+r mode "resize"

bindsym $mod+x exec ~/dotfiles/i3/lock.sh

set $bg-color             #2f343f
set $text-color           #f3f4f5
set $inactive-bg-color    #2f343f
set $inactive-text-color  #676e7d
set $urgent-bg-color      #e53945
set $urgent-text-color    #f3f4f5
set $active-bg-color      #c3839d
set $indicator            #689d6a

# Window colors:         Border              Background          Text                  Indicator
client.focused           $active-bg-color    $active-bg-color    $text-color           $indicator
client.unfocused         $inactive-bg-color  $inactive-bg-color  $inactive-text-color  $indicator
client.focused_inactive  $inactive-bg-color  $inactive-bg-color  $inactive-text-color  $indicator
client.urgent            $urgent-bg-color    $urgent-bg-color    $urgent-text-color    $indicator

# Start i3bar to display a workspace bar.
bar {
  colors {
    background $bg-color

    # Tag colors:       Border              Background          Text
    focused_workspace   $bg-color           $bg-color           $text-color
    inactive_workspace  $inactive-bg-color  $inactive-bg-color  $inactive-text-color
    urgent_workspace    $urgent-bg-color    $urgent-bg-color    $urgent-text-color
  }
  position top
  status_command ~/dotfiles/i3/bar.sh
}

exec VBoxClient-all
exec compton -f
exec_always xset r rate 200 80
exec_always feh --bg-fill ~/wallpapers/bg01.jpg
exec_always xrdb ~/.Xresources

exec spotify
exec dropbox