{{- $i3:= include ".gen/i3.json" | mustFromJson -}} # i3 config file (v4) # TODO: add scratchpads (terminal, password manager, discord, task) #------------------------------------------------------------------------------- #----- VARIABLES #------------------------------------------------------------------------------- set $HOME {{ .chezmoi.homeDir }} set $DISP_PRI {{ $i3.disp_pri }} set $DISP_SEC {{ $i3.disp_sec }} set $BOR_WIDTH 4 set $GAP_INNER 4 set $mod Mod4 set $tag1 "1:game" set $tag2 "2:dev" set $tag3 "3:web" set $tag4 "4:web" set $tag5 "5:web" set $tag6 "6:web" set $tag7 "7:comm" set $tag8 "8:task" #------------------------------------------------------------------------------- #----- COLORS #------------------------------------------------------------------------------- # class border bground text indicator child_border client.focused #6272A4 #6272A4 #F8F8F2 #6272A4 #6272A4 client.focused_inactive #44475A #44475A #F8F8F2 #44475A #44475A client.unfocused #282A36 #282A36 #BFBFBF #282A36 #282A36 client.urgent #44475A #FF5555 #F8F8F2 #FF5555 #FF5555 client.placeholder #282A36 #282A36 #F8F8F2 #282A36 #282A36 client.background #F8F8F2 #------------------------------------------------------------------------------- #----- MISC. CONFIGURATION #------------------------------------------------------------------------------- font pango:Google Noto 8.5 default_border pixel 1 default_floating_border pixel 1 #------------------------------------------------------------------------------- #----- BINDING WORKSPACE TO DISPLAY #------------------------------------------------------------------------------- workspace $tag1 output $DISP_PRI workspace $tag2 output $DISP_PRI workspace $tag3 output $DISP_PRI workspace $tag4 output $DISP_PRI workspace $tag5 output $DISP_SEC workspace $tag6 output $DISP_SEC workspace $tag7 output $DISP_SEC workspace $tag8 output $DISP_SEC #------------------------------------------------------------------------------- #----- CONTAINER GAPS #------------------------------------------------------------------------------- # CREATING GAPS BETWEEN THE WINDOWS AND EDGES gaps inner $GAP_INNER gaps outer 0 gaps horizontal 0 gaps vertical 0 gaps top 0 gaps bottom 0 gaps right 0 gaps left 0 #------------------------------------------------------------------------------- #----- FORCE FLOATING #------------------------------------------------------------------------------- for_window [title="Steam - News"] floating enable for_window [title="Friends List"] floating enable for_window [title="Picture-in-Picture"] sticky toggle for_window [con_mark="scratch-term"] floating enable, \ resize set 800 px 600 px, \ move position 880 px 420 px for_window [con_mark="scratch-nnn"] floating enable, \ resize set 800 px 600 px, \ move position 880 px 420 px for_window [con_mark="scratch-warden"] floating enable, \ resize set 1000 px 800 px, \ move position 780 px 320 px for_window [con_mark="scratch-warrior"] floating enable, \ resize set 1000 px 800 px, \ move position 780 px 320 px #------------------------------------------------------------------------------- #----- BINDING APPLICATIONS TO WORKSPACE #------------------------------------------------------------------------------- assign [class="Steam"] "1:game" for_window [class="Steam"] move container to workspace "1:game" #------------------------------------------------------------------------------- #----- KEY BINDINGS #------------------------------------------------------------------------------- # i3 utility commands bindsym $mod+Ctrl+r exec chezmoi apply && i3-msg restart bindsym $mod+Ctrl+q exit bindsym $mod+Ctrl+h resize shrink width 50 bindsym $mod+Ctrl+j resize shrink height 50 bindsym $mod+Ctrl+k resize grow height 50 bindsym $mod+Ctrl+l resize grow width 50 # layout commands bindsym $mod+z layout splith bindsym $mod+x layout tabbed bindsym $mod+c layout stacked bindsym $mod+v layout splitv bindsym $mod+s split h bindsym $mod+Shift+s split v # program management bindsym $mod+d kill bindsym $mod+f fullscreen toggle bindsym $mod+t floating toggle bindsym $mod+g sticky toggle bindsym $mod+Tab focus mode_toggle floating_modifier $mod # spatial container management bindsym $mod+h focus left bindsym $mod+j focus down bindsym $mod+k focus up bindsym $mod+l focus right bindsym $mod+Shift+h move left bindsym $mod+Shift+j move down bindsym $mod+Shift+k move up bindsym $mod+Shift+l move right # workspace management bindsym $mod+1 workspace $tag1 bindsym $mod+2 workspace $tag2 bindsym $mod+3 workspace $tag3 bindsym $mod+4 workspace $tag4 bindsym $mod+q workspace $tag5 bindsym $mod+w workspace $tag6 bindsym $mod+e workspace $tag7 bindsym $mod+r workspace $tag8 bindsym $mod+Shift+1 move container to workspace $tag1 bindsym $mod+Shift+2 move container to workspace $tag2 bindsym $mod+Shift+3 move container to workspace $tag3 bindsym $mod+Shift+4 move container to workspace $tag4 bindsym $mod+Shift+q move container to workspace $tag5 bindsym $mod+Shift+w move container to workspace $tag6 bindsym $mod+Shift+e move container to workspace $tag7 bindsym $mod+Shift+r move container to workspace $tag8 # system utils bindsym XF86AudioRaiseVolume exec pactl set-sink-volume 0 +2% bindsym XF86AudioLowerVolume exec pactl set-sink-volume 0 -2% bindsym XF86AudioMute exec amixer -q set Master toggle # TODO: flameshot (mod+Ctrl+f) # TODO: gamemode (mod+Ctrl+g). Needs script to toggle # open applications bindsym $mod+Return exec kitty bindsym $mod+a exec rofi -show drun -theme gruvbox-dark-soft -show-icons bindsym $mod+Shift+a exec rofi -show window -theme gruvbox-dark-soft -show-icons bindsym $mod+u exec firefox bindsym $mod+i exec steam # open scratchpads bindsym $mod+Shift+Return exec $HOME/.config/i3/scripts/scratch.sh \ 'scratch-term' 'kitty' bindsym $mod+n exec $HOME/.config/i3/scripts/scratch.sh \ 'scratch-nnn' 'kitty -e nnn -d -e -H -r' bindsym $mod+b exec --no-startup-id $HOME/.config/i3/scripts/scratch.sh \ 'scratch-warden' 'firefoxpwa site launch 01GKYZS658452DK05DVDCRF5V4' bindsym $mod+m exec $HOME/.config/i3/scripts/scratch.sh \ 'scratch-warrior' 'kitty -e taskwarrior-tui' #------------------------------------------------------------------------------- #----- AUTOSTART WITH I3 #------------------------------------------------------------------------------- exec --no-startup-id "$HOME/.config/i3/scripts/xrandr.sh && \ chezmoi apply && \ i3-msg restart && \ $HOME/.config/i3/scripts/polybar.sh" exec_always --no-startup-id nitrogen --restore