main dotfiles / dot_config / sway / config
Eric Bower  ·  2026-09-02
  1# Read `man 5 sway` for a complete reference.
  2
  3set $mod Mod4
  4set $left h
  5set $down j
  6set $up k
  7set $right l
  8set $font "JetBrainsMono Nerd Font 10.5"
  9
 10# 16-bit Terminal Palette (Monokai Classic)
 11set $bg         #272822
 12set $fg         #f8f8f2
 13
 14# Standard ANSI (0-7)
 15set $black      #272822
 16set $red        #f92672
 17set $green      #a6e22e
 18set $yellow     #e6db74
 19set $blue       #66d9ef
 20set $magenta    #ae81ff
 21set $cyan       #a1efe4
 22set $white      #f8f8f2
 23
 24# Bright ANSI (8-15)
 25set $br_black   #75715e
 26set $br_red     #fd971f
 27set $br_green   #a6e22e
 28set $br_yellow  #e6db74
 29set $br_blue    #66d9ef
 30set $br_magenta #ae81ff
 31set $br_cyan    #a1efe4
 32set $br_white   #f8f8f2
 33
 34# ==============================================================================
 35
 36# Systemd & D-Bus environment activation and session startup
 37exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY SWAYSOCK DISPLAY && \
 38     systemctl --user start wayland-session.target
 39
 40# ==============================================================================
 41
 42default_border pixel 2
 43smart_borders on
 44
 45# Color scheme               border    bg        text      indicator child_border
 46client.focused               $blue     $bg       $fg       $red      $blue
 47client.focused_inactive      $br_black $bg       $white    $br_black $br_black
 48client.unfocused             $br_black $bg       $white    $br_black $br_black
 49client.urgent                $red      $red      $bg       $red      $red
 50client.placeholder           $br_black $bg       $white    $br_black $br_black
 51client.background            $bg
 52
 53# ==============================================================================
 54
 55input "type:touchpad" {
 56    tap enabled
 57    natural_scroll disabled
 58    dwt disabled
 59    accel_profile "flat"  # disable mouse acceleration
 60    pointer_accel 0.0     # set mouse sensitivity (between -1 and 1)
 61}
 62
 63input "type:keyboard" {
 64    repeat_delay 300
 65    repeat_rate 30
 66}
 67
 68input "20547:23623:Ploopy_Corporation_Ploopy_Adept_Trackball_Mouse" {
 69    accel_profile "flat"
 70    pointer_accel -0.5    # between -1 and 1
 71}
 72
 73# ==============================================================================
 74
 75floating_modifier $mod normal
 76
 77# --- Hardware / Function Keys ---
 78bindsym --locked XF86AudioRaiseVolume  exec pamixer -i 5
 79bindsym --locked XF86AudioLowerVolume  exec pamixer -d 5
 80bindsym --locked XF86AudioMute         exec pamixer -t
 81bindsym --locked XF86AudioMicMute      exec pamixer --default-source -t
 82
 83bindsym --locked XF86AudioPlay         exec playerctl play-pause
 84bindsym --locked XF86AudioNext         exec playerctl next
 85bindsym --locked XF86AudioPrev         exec playerctl previous
 86
 87bindsym --locked XF86MonBrightnessUp   exec brightnessctl set +5%
 88bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
 89
 90# --- Display & Lid Switch ---
 91set $laptop eDP-1
 92bindswitch --locked lid:on  exec loginctl lock-session; output $laptop disable
 93bindswitch --locked --reload lid:off output $laptop enable
 94
 95# --- Core & Applications ---
 96bindsym $mod+Return exec monstar
 97bindsym $mod+q kill
 98bindsym $mod+d exec wmenu-run -f $font -N "$bg" -n "$fg" -S "$blue" -s "$bg" -p "run: "
 99bindsym $mod+Shift+s exec screenshot
100
101# --- Session Management ---
102bindsym $mod+Alt+l exec loginctl lock-session
103bindsym $mod+Shift+c reload
104bindsym $mod+Shift+e exec swaynag -t warning \
105    -m 'Exit sway?' \
106    -b 'Exit' 'systemctl --user stop wayland-session.target; swaymsg exit'
107
108# --- Window Layout & Manipulation ---
109bindsym $mod+z splith
110bindsym $mod+x splitv
111bindsym $mod+w layout tabbed
112bindsym $mod+e layout toggle split
113bindsym $mod+f fullscreen
114bindsym $mod+space focus mode_toggle
115bindsym $mod+Shift+space floating toggle
116bindsym $mod+Shift+minus move scratchpad
117bindsym $mod+minus scratchpad show
118
119# --- Focus Navigation ---
120bindsym $mod+$left focus left
121bindsym $mod+$down focus down
122bindsym $mod+$up focus up
123bindsym $mod+$right focus right
124bindsym $mod+a focus parent
125bindsym $mod+Shift+a focus child
126
127# --- Move Windows ---
128bindsym $mod+Shift+$left move left
129bindsym $mod+Shift+$down move down
130bindsym $mod+Shift+$up move up
131bindsym $mod+Shift+$right move right
132
133# --- Workspace Switching (1-10) ---
134bindsym $mod+1 workspace number 1
135bindsym $mod+2 workspace number 2
136bindsym $mod+3 workspace number 3
137bindsym $mod+4 workspace number 4
138bindsym $mod+5 workspace number 5
139bindsym $mod+6 workspace number 6
140bindsym $mod+7 workspace number 7
141bindsym $mod+8 workspace number 8
142bindsym $mod+9 workspace number 9
143bindsym $mod+0 workspace number 10
144
145# --- Move Container to Workspace (1-10) ---
146bindsym $mod+Shift+1 move container to workspace number 1
147bindsym $mod+Shift+2 move container to workspace number 2
148bindsym $mod+Shift+3 move container to workspace number 3
149bindsym $mod+Shift+4 move container to workspace number 4
150bindsym $mod+Shift+5 move container to workspace number 5
151bindsym $mod+Shift+6 move container to workspace number 6
152bindsym $mod+Shift+7 move container to workspace number 7
153bindsym $mod+Shift+8 move container to workspace number 8
154bindsym $mod+Shift+9 move container to workspace number 9
155bindsym $mod+Shift+0 move container to workspace number 10
156
157# ==============================================================================
158
159# bar {
160#     position bottom
161#     status_command python3 ~/.config/sway/status.py
162#     font pango:$font
163# 
164#     colors {
165#         background $bg
166#         statusline $fg
167#         separator  $br_black
168# 
169#         focused_workspace  $blue     $blue     $bg
170#         active_workspace   $br_black $br_black $fg
171#         inactive_workspace $bg       $bg       $white
172#         urgent_workspace   $red      $red      $bg
173#     }
174# }