# sway config file (v4) # TODO: add scratchpads (terminal, password manager, discord, task) #------------------------------------------------------------------------------- #----- VARIABLES #------------------------------------------------------------------------------- set $HOME /home/tstarr set $DISP_PRI DP-2 set $DISP_SEC HDMI-A-1 set $BOR_WIDTH 3 set $GAP_INNER 3 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 $e exec swaymsg mode default set $mode_power "[r]eboot | [s]hutdown" set $TERM alacritty #------------------------------------------------------------------------------- #----- COLORS #------------------------------------------------------------------------------- set $background #282A36 set $foreground #F8F8F2 set $focused #bd93f9 set $inactive #44475A set $urgent #FF5555 # class border bground text indicator child_border client.focused $focused $focused $foreground $focused $focused client.focused_inactive $inactive $inactive $foreground $inactive $inactive client.unfocused $background $background $foreground $background $background client.urgent $inactive $urgent $foreground $urgent $urgent client.placeholder $background $background $foreground $background $background client.background $foreground #------------------------------------------------------------------------------- #----- MISC. CONFIGURATION #------------------------------------------------------------------------------- font pango:JetBrains Mono Nerd Font 10 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_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 [app_id="file"] floating enable, \ border pixel 5, \ resize set 70 ppt 60 ppt, \ move position center, \ move to scratchpad, \ scratchpad show #------------------------------------------------------------------------------- #----- 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 for_window [title="launcher"] floating enable #------------------------------------------------------------------------------- #----- KEY BINDINGS #------------------------------------------------------------------------------- # [p]ower commands bindsym $mod+p mode $mode_power mode $mode_power { bindsym s exec shutdown now bindsym r exec reboot bindsym Escape mode default } # [x]utility commands bindsym $mod+x mode utility mode utility { bindsym q exit bindsym r reload bindsym g exec "~/.config/sway/scripts/gamemode.sh", $e bindsym Escape mode default } # layout commands bindsym $mod+Ctrl+t splitv; layout tabbed bindsym $mod+Ctrl+v layout splitv bindsym $mod+Ctrl+s layout splith 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 bindsym $mod+Ctrl+c move position center # program management bindsym $mod+d kill bindsym $mod+f fullscreen toggle bindsym $mod+t floating toggle bindsym $mod+s sticky toggle bindsym $mod+Tab focus mode_toggle floating_modifier $mod # spatial container management bindsym $mod+h exec ~/.config/sway/scripts/tabfocus.sh "h" bindsym $mod+j exec ~/.config/sway/scripts/tabfocus.sh "j" bindsym $mod+k exec ~/.config/sway/scripts/tabfocus.sh "k" bindsym $mod+l exec ~/.config/sway/scripts/tabfocus.sh "l" 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 bindsym $mod+z splith; layout tabbed; focus parent bindsym $mod+Shift+z layout default # 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 # audio bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +2% bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -2% bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle # [o]pen applications bindsym $mod+Return exec alacritty bindsym $mod+a mode launcher mode launcher { bindsym r exec alacritty --title launcher -e /home/{{ .user }}/bin/linux-app-launcher, $e #bindsym w exec rofi -show window -show-icons, $e #bindsym e exec rofi -modi emoji -show emoji, $e bindsym Escape mode default } bindsym $mod+o mode open mode open { bindsym b exec firefox, $e bindsym s exec steam || flatpak run com.valvesoftware.Steam, $e bindsym d exec discord || flatpak run com.discordapp.Discord, $e bindsym Escape mode default } # s[c]ratchpads commands bindsym $mod+c mode scratch mode scratch { bindsym Return exec ~/.cargo/bin/sway-scratchpad \ --command "alacritty" \ --mark term \ --width 40 \ --height 71, $e bindsym b exec ~/.cargo/bin/sway-scratchpad \ --command "blueman-manager" \ --mark blue \ --width 40 \ --height 71, $e bindsym f exec ~/.cargo/bin/sway-scratchpad \ --command "alacritty -e /home/{{ .user }}/.local/bin/tmuxp load /home/{{ .user }}/.config/tmuxp/files.yml" \ --mark files \ --width 71 \ --height 71, $e bindsym Shift+c move scratchpad, $e bindsym c scratchpad show, $e bindsym Escape mode default } output HDMI-A-1 { resolution 2560x1440@143.912Hz position 0,0 } output DP-3 { resolution 2560x1440@143.973Hz position 2560,0 } bar { position top status_command while ~/.config/sway/scripts/status.sh; do sleep 1; done tray_output none pango_markup enabled colors { background #000000 focused_workspace $focused $focused $background } } #------------------------------------------------------------------------------- #----- AUTOSTART WITH I3 #------------------------------------------------------------------------------- exec_always --no-startup-id "dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK" exec_always --no-startup-id "configure-gtk" exec --no-startup-id "~/.config/sway/scripts/idle.sh" exec --no-startup-id "udiskie"