Commit f662a0a

Eric Bower  ·  2026-09-01 21:08:11 -0400 EDT
parent de48305
refactor: sway cfg

I move many of the wayland daemons cfg into their own files and move them to
systemd unit files.
8 files changed,  +122, -79
+20, -0
 1@@ -0,0 +1,20 @@
 2+#!/usr/bin/env bash
 3+
 4+set -euo pipefail
 5+
 6+PICTURES_DIR="$(xdg-user-dir PICTURES 2>/dev/null || echo "${HOME}/Pictures")"
 7+SCREENSHOT_DIR="${PICTURES_DIR}/Screenshots"
 8+mkdir -p "${SCREENSHOT_DIR}"
 9+
10+GEOM="$(slurp)"
11+if [[ -z "${GEOM}" ]]; then
12+    exit 0
13+fi
14+
15+FILE="${SCREENSHOT_DIR}/screenshot_$(date +'%Y-%m-%d_%H-%M-%S').png"
16+
17+grim -g "${GEOM}" "${FILE}"
18+wl-copy < "${FILE}"
19+notify-send -a "Screenshot" "Screenshot Saved" "${FILE}" -i "${FILE}"
20+
21+# kak: filetype=sh
+1, -0
1@@ -0,0 +1 @@
2+XDG_CURRENT_DESKTOP=sway
+18, -0
 1@@ -0,0 +1,18 @@
 2+# Kanshi output configuration
 3+
 4+# Laptop only (undocked)
 5+profile undocked {
 6+    output eDP-1 mode 2256x1504@59.999Hz scale 1.5
 7+}
 8+
 9+# Home desk setup (DP-3: LG Electronics LG ULTRAGEAR 312NTQD43916)
10+profile home {
11+    output eDP-1 mode 2256x1504@59.999Hz scale 1.5
12+    output DP-3 mode 2560x1440@144Hz scale 1.0
13+}
14+
15+# Cahoots setup (DP-2: Samsung Electric Company U32J59x HCJTB01080)
16+profile cahoots {
17+    output eDP-1 mode 2256x1504@59.999Hz scale 1.5
18+    output DP-2 scale 1.5
19+}
+69, -79
  1@@ -1,9 +1,11 @@
  2 # Read `man 5 sway` for a complete reference.
  3+
  4 set $mod Mod4
  5 set $left h
  6 set $down j
  7 set $up k
  8 set $right l
  9+set $font "JetBrainsMono Nerd Font 10.5"
 10 
 11 # 16-bit Terminal Palette (Monokai Classic)
 12 set $bg         #272822
 13@@ -29,6 +31,17 @@ set $br_magenta #ae81ff
 14 set $br_cyan    #a1efe4
 15 set $br_white   #f8f8f2
 16 
 17+# ==============================================================================
 18+
 19+# Systemd & D-Bus environment activation and session startup
 20+exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY SWAYSOCK DISPLAY && \
 21+     systemctl --user start wayland-session.target
 22+
 23+# ==============================================================================
 24+
 25+default_border pixel 2
 26+smart_borders on
 27+
 28 # Color scheme               border    bg        text      indicator child_border
 29 client.focused               $blue     $bg       $fg       $red      $blue
 30 client.focused_inactive      $br_black $bg       $white    $br_black $br_black
 31@@ -37,59 +50,87 @@ client.urgent                $red      $red      $bg       $red      $red
 32 client.placeholder           $br_black $bg       $white    $br_black $br_black
 33 client.background            $bg
 34 
 35-default_border pixel 2
 36-smart_borders on
 37+# ==============================================================================
 38 
 39-# Audio volume controls (pamixer)
 40-bindsym --locked XF86AudioRaiseVolume exec pamixer -i 5
 41-bindsym --locked XF86AudioLowerVolume exec pamixer -d 5
 42-bindsym --locked XF86AudioMute exec pamixer -t
 43-bindsym --locked XF86AudioMicMute exec pamixer --default-source -t
 44+input "type:touchpad" {
 45+    tap enabled
 46+    natural_scroll disabled
 47+    dwt disabled
 48+    accel_profile "flat"  # disable mouse acceleration
 49+    pointer_accel 0.0     # set mouse sensitivity (between -1 and 1)
 50+}
 51 
 52-# Media playback controls (playerctl)
 53-bindsym --locked XF86AudioPlay exec playerctl play-pause
 54-bindsym --locked XF86AudioNext exec playerctl next
 55-bindsym --locked XF86AudioPrev exec playerctl previous
 56+input "type:keyboard" {
 57+    repeat_delay 300
 58+    repeat_rate 30
 59+}
 60 
 61-# Screen brightness controls (brightnessctl)
 62-bindsym --locked XF86MonBrightnessUp exec brightnessctl set +5%
 63-bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
 64+input "20547:23623:Ploopy_Corporation_Ploopy_Adept_Trackball_Mouse" {
 65+    accel_profile "flat"
 66+    pointer_accel -0.5    # between -1 and 1
 67+}
 68 
 69-# Application Launcher (wmenu)
 70-bindsym $mod+d exec wmenu-run -f "JetBrainsMono Nerd Font 10.5" -N "#272822" -n "#f8f8f2" -S "#66d9ef" -s "#272822" -p "run: "
 71+# ==============================================================================
 72 
 73 floating_modifier $mod normal
 74+
 75+# --- Hardware / Function Keys ---
 76+bindsym --locked XF86AudioRaiseVolume  exec pamixer -i 5
 77+bindsym --locked XF86AudioLowerVolume  exec pamixer -d 5
 78+bindsym --locked XF86AudioMute         exec pamixer -t
 79+bindsym --locked XF86AudioMicMute      exec pamixer --default-source -t
 80+
 81+bindsym --locked XF86AudioPlay         exec playerctl play-pause
 82+bindsym --locked XF86AudioNext         exec playerctl next
 83+bindsym --locked XF86AudioPrev         exec playerctl previous
 84+
 85+bindsym --locked XF86MonBrightnessUp   exec brightnessctl set +5%
 86+bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
 87+
 88+# --- Display & Lid Switch ---
 89+set $laptop eDP-1
 90+bindswitch --locked lid:on  exec loginctl lock-session; output $laptop disable
 91+bindswitch --locked --reload lid:off output $laptop enable
 92+
 93+# --- Core & Applications ---
 94 bindsym $mod+Return exec monstar
 95 bindsym $mod+q kill
 96+bindsym $mod+d exec wmenu-run -f $font -N "$bg" -n "$fg" -S "$blue" -s "$bg" -p "run: "
 97+bindsym $mod+Shift+s exec screenshot
 98 
 99-bindsym $mod+c exec wl-copy
100-bindsym $mod+v exec wl-paste
101+# --- Session Management ---
102+bindsym $mod+Alt+l exec loginctl lock-session
103+bindsym $mod+Shift+c reload
104+bindsym $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 ---
109 bindsym $mod+z splith
110 bindsym $mod+x splitv
111 bindsym $mod+w layout tabbed
112 bindsym $mod+e layout toggle split
113 bindsym $mod+f fullscreen
114 bindsym $mod+space focus mode_toggle
115-bindsym $mod+Shift+s exec grim -g "$(slurp)" -t png ~/screenshot_$(date +%s).png
116-bindsym $mod+Shift+c reload
117-bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'
118 bindsym $mod+Shift+space floating toggle
119 bindsym $mod+Shift+minus move scratchpad
120 bindsym $mod+minus scratchpad show
121 
122-# Move your focus around
123+# --- Focus Navigation ---
124 bindsym $mod+$left focus left
125 bindsym $mod+$down focus down
126 bindsym $mod+$up focus up
127 bindsym $mod+$right focus right
128 bindsym $mod+a focus parent
129 bindsym $mod+Shift+a focus child
130-# Move the focused window with the same, but add Shift
131+
132+# --- Move Windows ---
133 bindsym $mod+Shift+$left move left
134 bindsym $mod+Shift+$down move down
135 bindsym $mod+Shift+$up move up
136 bindsym $mod+Shift+$right move right
137-# Switch to workspace
138+
139+# --- Workspace Switching (1-10) ---
140 bindsym $mod+1 workspace number 1
141 bindsym $mod+2 workspace number 2
142 bindsym $mod+3 workspace number 3
143@@ -100,7 +141,8 @@ bindsym $mod+7 workspace number 7
144 bindsym $mod+8 workspace number 8
145 bindsym $mod+9 workspace number 9
146 bindsym $mod+0 workspace number 10
147-# Move focused container to workspace
148+
149+# --- Move Container to Workspace (1-10) ---
150 bindsym $mod+Shift+1 move container to workspace number 1
151 bindsym $mod+Shift+2 move container to workspace number 2
152 bindsym $mod+Shift+3 move container to workspace number 3
153@@ -112,64 +154,12 @@ bindsym $mod+Shift+8 move container to workspace number 8
154 bindsym $mod+Shift+9 move container to workspace number 9
155 bindsym $mod+Shift+0 move container to workspace number 10
156 
157-set $home DP-3
158-# "LG Electronics LG ULTRAGEAR 312NTQD43916"
159-output $home mode 2560x1440@144Hz
160-output $home scale 1
161-
162-set $laptop eDP-1
163-output $laptop mode 2256x1504@59.999Hz
164-output $laptop scale 1.5
165-
166-output * bg ~/config/wallpapers/webb_telescope.png fill
167-
168-# set $cahoots DP-2
169-# Samsung Electric Company U32J59x HCJTB01080
170-# output $cahoots scale 1.5
171-
172-# Lock screen command
173-set $lock swaylock -f -F -e \
174-    -i ~/config/wallpapers/webb_telescope.png \
175-    --indicator-idle-visible
176-
177-bindsym $mod+Alt+l exec $lock
178-
179-# Laptop lid switch bindings
180-bindswitch --locked lid:on exec $lock; output $laptop disable
181-bindswitch --locked --reload lid:off output $laptop enable
182-
183-# Idle management (lock after 5 min, turn off displays after 10 min)
184-exec swayidle -w \
185-    timeout 300 '$lock' \
186-    timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
187-    before-sleep '$lock'
188-
189-# required for xdg-desktop-portal-gtk.service
190-exec systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP DISPLAY MOZ_ENABLE_WAYLAND
191-exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway DISPLAY MOZ_ENABLE_WAYLAND=1
192-exec wlsunset -l 42.3 -L -83.0 -t 3000
193-exec mako
194-
195-input "type:touchpad" {
196-    tap enabled
197-    natural_scroll disabled
198-    dwt disabled
199-    accel_profile "flat"  # disable mouse acceleration
200-    pointer_accel 0.0     # set mouse sensitivity (between -1 and 1)
201-}
202-input "type:keyboard" {
203-    repeat_delay 300
204-    repeat_rate 30
205-}
206-input "20547:23623:Ploopy_Corporation_Ploopy_Adept_Trackball_Mouse" {
207-  accel_profile "flat"
208-  pointer_accel -0.5 # between -1 and 1
209-}
210+# ==============================================================================
211 
212 bar {
213     position bottom
214     status_command python3 ~/.config/sway/status.py
215-    font pango:JetBrainsMono Nerd Font 10.5
216+    font pango:$font
217 
218     colors {
219         background $bg
+5, -0
1@@ -0,0 +1,5 @@
2+# Swayidle configuration
3+timeout 300 'swaylock'
4+timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"'
5+before-sleep 'swaylock'
6+lock 'swaylock'
+7, -0
1@@ -0,0 +1,7 @@
2+# Swaylock configuration
3+image=~/config/wallpapers/webb_telescope.png
4+scaling=fill
5+daemonize
6+show-failed-attempts
7+indicator-idle-visible
8+ignore-empty-password
+1, -0
1@@ -44,6 +44,7 @@ jq
2 jujutsu
3 kakoune
4 kakoune-lsp
5+kanshi
6 keychain
7 kubectl
8 libnotify
+1, -0
1@@ -32,6 +32,7 @@ jq
2 jujutsu
3 kakoune
4 kakoune-lsp
5+kanshi
6 keychain
7 keyd
8 libnotify