{{- $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:dev" set $tag5 "5:web" set $tag6 "6:web" set $tag7 "7:web" set $tag8 "8:comm" set $tag9 "9:eng" set $tag0 "10:web" set $e exec i3-msg mode default set $mode_power "[r]eboot | [s]hutdown" #------------------------------------------------------------------------------- #----- COLORS #------------------------------------------------------------------------------- # class border bground text indicator child_border client.focused #bd93f9 #bd93f9 #F8F8F2 #bd93f9 #bd93f9 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 3 default_floating_border pixel 3 #------------------------------------------------------------------------------- #----- 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_PRI workspace $tag6 output $DISP_SEC workspace $tag7 output $DISP_SEC workspace $tag8 output $DISP_SEC workspace $tag9 output $DISP_SEC workspace $tag0 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 for_window [class="Blueman-manager"] floating enable, \ resize set 1000 px 800 px, \ move position 780 px 320 px for_window [class="Nm-connection-editor"] 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" for_window [class="discord"] move container to workspace $tag8 #------------------------------------------------------------------------------- #----- KEY BINDINGS #------------------------------------------------------------------------------- # [p]ower commands bindsym $mod+p mode $mode_power mode $mode_power { bindsym s exec loginctl poweroff bindsym r exec loginctl reboot bindsym Escape mode default } # [x]utility commands bindsym $mod+x mode utility mode utility { bindsym q exit bindsym r exec chezmoi apply && i3-msg restart bindsym c exec "CM_LAUNCHER=rofi clipmenu -i", $e # TODO: flameshot (mod+Ctrl+f) # TODO: gamemode (mod+Ctrl+g). Needs script to toggle bindsym Escape mode default } # layo[u]t commands bindsym $mod+u mode layout mode layout { bindsym z layout splith bindsym x layout tabbed bindsym c layout stacked bindsym v layout splitv bindsym h resize shrink width 50 bindsym j resize shrink height 50 bindsym k resize grow height 50 bindsym l resize grow width 50 bindsym Escape mode default } # program management bindsym $mod+d kill bindsym $mod+f fullscreen toggle bindsym $mod+y floating toggle bindsym $mod+s 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 bindsym $mod+minus split v bindsym $mod+backslash split h # workspace management bindsym $mod+1 workspace $tag1 bindsym $mod+2 workspace $tag2 bindsym $mod+3 workspace $tag3 bindsym $mod+4 workspace $tag4 bindsym $mod+5 workspace $tag5 bindsym $mod+q workspace $tag6 bindsym $mod+w workspace $tag7 bindsym $mod+e workspace $tag8 bindsym $mod+r workspace $tag9 bindsym $mod+t workspace $tag0 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+5 move container to workspace $tag5 bindsym $mod+Shift+q move container to workspace $tag6 bindsym $mod+Shift+w move container to workspace $tag7 bindsym $mod+Shift+e move container to workspace $tag8 bindsym $mod+Shift+r move container to workspace $tag9 bindsym $mod+Shift+t move container to workspace $tag0 # audio 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 # [o]pen applications bindsym $mod+Return exec alacritty bindsym $mod+a exec rofi -show drun -show-icons bindsym $mod+Shift+a exec rofi -show window -show-icons bindsym $mod+o mode open mode open { bindsym b exec firefox, $e bindsym s exec steam, $e bindsym d exec flatpak run com.discordapp.Discord, $e bindsym Escape mode default } # s[c]ratchpads commands bindsym $mod+c mode scratch mode scratch { bindsym Return exec $HOME/.config/i3/scripts/scratch.sh \ 'scratch-term' 'alacritty', $e bindsym b exec --no-startup-id $HOME/.config/i3/scripts/scratch.sh \ 'scratch-warden' 'firefoxpwa site launch 01GKYZS658452DK05DVDCRF5V4, $e' bindsym n exec $HOME/.config/i3/scripts/scratch.sh \ 'scratch-nnn' 'alacritty -e nnn -d -e -H -r', $e bindsym t exec $HOME/.config/i3/scripts/scratch.sh \ 'scratch-warrior' 'alacritty -e taskwarrior-tui', $e bindsym Escape mode default } #------------------------------------------------------------------------------- #----- AUTOSTART WITH I3 #------------------------------------------------------------------------------- exec --no-startup-id "autorandr --change && i3-msg restart" exec --no-startup-id "pipewire & pipewire-pulse &" exec_always --no-startup-id "$HOME/.config/i3/scripts/polybar.sh" exec --no-startup-id "clipmenud" exec_always --no-startup-id "nm-applet" exec_always --no-startup-id "blueman-applet" exec_always --no-startup-id nitrogen --restore