···11+set $mod Mod4
22+33+# Font for window titles. Also used by the bar unless overridden in its block.
44+font pango:DejaVu Sans Mono 12
55+66+# PORT: name the apps once and reference them below.
77+# Terminal is Ghostty (configured elsewhere in these dotfiles).
88+set $term ghostty
99+# PORT: dmenu is X11-only. wofi is a common Wayland launcher (drun = .desktop apps).
1010+# Alternatives: bemenu-run, wmenu-run (sway's modern default), fuzzel.
1111+set $menu wofi --show drun
1212+1313+# Use Mouse+$mod to drag floating windows to their wanted position
1414+floating_modifier $mod
1515+1616+# start a terminal
1717+# PORT: was `exec i3-sensible-terminal`
1818+bindsym $mod+Return exec $term
1919+2020+# kill focused window
2121+bindsym $mod+Shift+apostrophe kill
2222+2323+# start a program launcher
2424+bindsym $mod+d exec $menu
2525+# There also is the (new) i3-dmenu-desktop which only displays applications
2626+# shipping a .desktop file. It is a wrapper around dmenu, so you need that
2727+# installed.
2828+# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
2929+3030+# alternatively, you can use the cursor keys:
3131+bindsym $mod+Left focus left
3232+bindsym $mod+Down focus down
3333+bindsym $mod+Up focus up
3434+bindsym $mod+Right focus right
3535+3636+3737+# alternatively, you can use the cursor keys:
3838+bindsym $mod+Shift+Left move left
3939+bindsym $mod+Shift+Down move down
4040+bindsym $mod+Shift+Up move up
4141+bindsym $mod+Shift+Right move right
4242+4343+# move workspaces
4444+bindsym Mod4+Control+Left workspace prev
4545+bindsym Mod4+Control+Right workspace next
4646+bindsym Mod4+Control+Shift+Left move container to workspace prev
4747+bindsym Mod4+Control+Shift+Right move container to workspace next
4848+4949+# split in horizontal orientation
5050+bindsym $mod+h split h
5151+5252+# split in vertical orientation
5353+bindsym $mod+v split v
5454+5555+# enter fullscreen mode for the focused container
5656+bindsym $mod+f fullscreen toggle
5757+5858+# change container layout (stacked, tabbed, splitv)
5959+bindsym $mod+s layout stacking
6060+bindsym $mod+t layout tabbed
6161+bindsym $mod+e layout splitv
6262+6363+# toggle tiling / floating
6464+bindsym $mod+Shift+space floating toggle
6565+6666+# change focus between tiling / floating windows
6767+bindsym $mod+space focus mode_toggle
6868+6969+# enable imagej floating
7070+for_window [title="\(Fiji Is Just\) ImageJ"] floating enable
7171+7272+# focus the parent container
7373+bindsym $mod+a focus parent
7474+7575+# focus the child container
7676+#bindsym $mod+d focus child
7777+7878+# switch to workspace
7979+bindsym $mod+1 workspace number 1
8080+bindsym $mod+2 workspace number 2
8181+bindsym $mod+3 workspace number 3
8282+bindsym $mod+4 workspace number 4
8383+bindsym $mod+5 workspace number 5
8484+bindsym $mod+6 workspace number 6
8585+bindsym $mod+7 workspace number 7
8686+bindsym $mod+8 workspace number 8
8787+bindsym $mod+9 workspace number 9
8888+bindsym $mod+0 workspace number 10
8989+9090+# move focused container to workspace
9191+bindsym $mod+Shift+1 move container to workspace number 1, workspace number 1
9292+bindsym $mod+Shift+2 move container to workspace number 2, workspace number 2
9393+bindsym $mod+Shift+3 move container to workspace number 3, workspace number 3
9494+bindsym $mod+Shift+4 move container to workspace number 4, workspace number 4
9595+bindsym $mod+Shift+5 move container to workspace number 5, workspace number 5
9696+bindsym $mod+Shift+6 move container to workspace number 6, workspace number 6
9797+bindsym $mod+Shift+7 move container to workspace number 7, workspace number 7
9898+bindsym $mod+Shift+8 move container to workspace number 8, workspace number 8
9999+bindsym $mod+Shift+9 move container to workspace number 9, workspace number 9
100100+bindsym $mod+Shift+0 move container to workspace number 10, workspace number 10
101101+102102+# rename current workspace
103103+# PORT: i3-input is X11-only. sway has no built-in input prompt; this uses a
104104+# small helper. If you don't have one, install e.g. `swayrename` or replace the
105105+# prompt with wofi/bemenu. Original line kept below for reference.
106106+# bindsym $mod+n exec i3-input -F 'rename workspace to "%s"' -P 'New name: ' -f "pango:DejaVu Sans Mono 32"
107107+bindsym $mod+n exec swaymsg rename workspace to "$(echo '' | wofi --dmenu -p 'New name:')"
108108+109109+# reload the configuration file
110110+bindsym $mod+Shift+c reload
111111+# OBSOLETE: i3's `restart` does an X11 in-place restart; sway has no equivalent.
112112+# `reload` (above) already re-reads the config. Original kept for reference.
113113+# bindsym $mod+Shift+r restart
114114+# exit sway (logs you out of your Wayland session)
115115+# PORT: i3-nagbar -> swaynag, i3-msg -> swaymsg
116116+bindsym $mod+Shift+period 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'
117117+118118+# startup programs
119119+exec --no-startup-id nm-applet --indicator
120120+exec --no-startup-id dropbox start
121121+122122+# keyboard and trackpad settings
123123+input "type:keyboard" {
124124+ xkb_layout us,us
125125+ xkb_variant dvorak,
126126+ # grp:shifts_toggle = press both Shifts together to switch layout
127127+ # (dvorak <-> qwerty). Works on the swaylock screen too, since it's xkb-level.
128128+ xkb_options grp:shifts_toggle,compose:prsc,caps:escape,altwin:swap_lalt_lwin
129129+}
130130+131131+# PORT: synclient/syndaemon are the old X11 synaptics driver, replaced by
132132+# libinput. Configure the touchpad with a sway input block instead.
133133+# Original: synclient PalmDetect=1 HorizTwoFingerScroll=1 VertScrollDelta=-243 \
134134+# HorizScrollDelta=-243 TapButton1=0 (negative deltas = natural scroll,
135135+# TapButton1=0 = tap-to-click disabled)
136136+# Original: syndaemon -i 0.5 -K -t (ignore taps while typing -> dwt)
137137+input "type:touchpad" {
138138+ # tap disabled
139139+ natural_scroll enabled
140140+ scroll_method two_finger
141141+ dwt enabled
142142+}
143143+144144+# PORT: feh is X11-only; sway sets wallpapers natively via `output`.
145145+# Original: exec feh --bg-fill /usr/share/backgrounds/Halifax_Sunset_by_Vlad_Drobinin.jpg
146146+output * bg /usr/share/backgrounds/cosmic/orion_nebula_nasa_heic0601a.jpg fill
147147+148148+# Audio controls.
149149+# PORT: switched from pactl-with-hardcoded-sink-0 to wpctl (native PipeWire
150150+# tool, already installed). @DEFAULT_AUDIO_SINK@ follows the real default sink,
151151+# so this keeps working across HDMI/Bluetooth/dock changes. -l 1.0 caps volume
152152+# at 100% so RaiseVolume can't push past it.
153153+# Original: pactl set-sink-mute 0 0 && pactl set-sink-volume 0 +5%
154154+# pactl set-sink-mute 0 0 && pactl set-sink-volume 0 -5%
155155+# pactl set-sink-mute 0 toggle
156156+bindsym XF86AudioRaiseVolume exec wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%+
157157+bindsym XF86AudioLowerVolume exec wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%-
158158+bindsym XF86AudioMute exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
159159+160160+# Screen brightness controls.
161161+# PORT: switched from `light` (not installed; setuid-based) to brightnessctl,
162162+# which talks to systemd-logind and so works in the active sway session without
163163+# the video group or a setuid bit -- the same logind path COSMIC used natively.
164164+# Install with: sudo apt install brightnessctl
165165+# Original: light -A 10 / light -U 10
166166+bindsym XF86MonBrightnessUp exec brightnessctl set 10%+ # increase screen brightness
167167+bindsym XF86MonBrightnessDown exec brightnessctl set 10%- # decrease screen brightness
168168+169169+# Screen lock (plain swaylock -- no effects fork needed).
170170+# PORT: replaces the old X11 i3lock-based ~/scripts/fuzzy-lock.sh.
171171+# Original: bindsym Control+Mod4+l exec "~/scripts/fuzzy-lock.sh"
172172+#
173173+# swaylock uses the ext-session-lock-v1 protocol: the compositor keeps the
174174+# screen locked even if the locker crashes, so it fails secure.
175175+#
176176+# No blur (that needs the unmaintained swaylock-effects fork). Instead we use
177177+# the same nebula wallpaper as the desktop, scaled to fill, with a themed
178178+# indicator ring that changes colour by state: idle=purple, typing-highlight=
179179+# bright purple, backspace=red, verifying=amber, wrong=red, cleared=green.
180180+# Colours are RRGGBBAA hex without a leading '#'.
181181+# $lock is defined once and reused by the hotkey and swayidle below.
182182+set $lock swaylock -f \
183183+ --image /usr/share/backgrounds/cosmic/orion_nebula_nasa_heic0601a.jpg \
184184+ --scaling fill \
185185+ --font "DejaVu Sans Mono" \
186186+ --indicator-radius 110 \
187187+ --indicator-thickness 8 \
188188+ --indicator-caps-lock \
189189+ --show-failed-attempts \
190190+ --show-keyboard-layout \
191191+ --inside-color 1e1e2ecc \
192192+ --inside-clear-color 1e2e1ecc \
193193+ --inside-ver-color 2e2a1ecc \
194194+ --inside-wrong-color 2e1e1ecc \
195195+ --ring-color 7c5cbfff \
196196+ --ring-clear-color a3be8cff \
197197+ --ring-ver-color ebcb8bff \
198198+ --ring-wrong-color bf616aff \
199199+ --key-hl-color 9d7cffff \
200200+ --bs-hl-color bf616aff \
201201+ --line-uses-ring \
202202+ --separator-color 00000000 \
203203+ --text-color e0def4ff \
204204+ --text-clear-color e0def4ff \
205205+ --text-ver-color e0def4ff \
206206+ --text-wrong-color e0def4ff
207207+208208+# Manual lock
209209+bindsym Control+Mod4+l exec $lock
210210+211211+# Auto-lock + display power management.
212212+# - lock after 5 min idle
213213+# - blank the outputs after 10 min (and restore on activity)
214214+# - always lock right before the system suspends, so it's locked on resume
215215+exec swayidle -w \
216216+ timeout 300 '$lock' \
217217+ timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
218218+ before-sleep '$lock'
219219+220220+# resize window (you can also use the mouse for that)
221221+mode "resize" {
222222+ # These bindings trigger as soon as you enter the resize mode
223223+224224+ # Pressing left will shrink the window’s width.
225225+ # Pressing right will grow the window’s width.
226226+ # Pressing up will shrink the window’s height.
227227+ # Pressing down will grow the window’s height.
228228+ bindsym h resize shrink width 5 px or 5 ppt
229229+ bindsym t resize grow height 5 px or 5 ppt
230230+ bindsym n resize shrink height 5 px or 5 ppt
231231+ bindsym s resize grow width 5 px or 5 ppt
232232+233233+ # same bindings, but for the arrow keys
234234+ bindsym Left resize shrink width 5 px or 5 ppt
235235+ bindsym Down resize shrink height 5 px or 5 ppt
236236+ bindsym Up resize grow height 5 px or 5 ppt
237237+ bindsym Right resize grow width 5 px or 5 ppt
238238+239239+ # back to normal: Enter or Escape
240240+ bindsym Return mode "default"
241241+ bindsym Escape mode "default"
242242+}
243243+244244+bindsym $mod+r mode "resize"
245245+246246+# Start swaybar to display a workspace bar (plus i3status' system information).
247247+# i3status is compositor-agnostic and works under sway unchanged.
248248+bar {
249249+ status_command i3status -c ~/.config/sway/i3status.conf
250250+ tray_output primary
251251+}
252252+253253+# Make sure apps and the tray see the Wayland/desktop environment.
254254+# PORT: needed so xdg-desktop-portal, the tray, and dbus-activated apps work.
255255+exec --no-startup-id dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
+88
sway/i3status.conf
···11+# i3status configuration file, used by the sway `bar` block.
22+# see "man i3status" for documentation.
33+#
44+# i3status is compositor-agnostic (it reads /sys and /proc), so this works
55+# unchanged under sway. Porting markers:
66+# # PORT: adjusted for a modern Wayland/PipeWire setup
77+# # OBSOLETE: kept for reference but redundant/unsupported on a current system
88+#
99+# It is important that this file is edited as UTF-8.
1010+# The following line should contain a sharp s:
1111+# ß
1212+# If the above line is not correctly displayed, fix your editor first!
1313+1414+general {
1515+ colors = true
1616+ interval = 5
1717+}
1818+1919+order += "ipv6"
2020+order += "disk /"
2121+order += "wireless _first_"
2222+order += "ethernet _first_"
2323+order += "battery 0"
2424+order += "load"
2525+order += "tztime madrid"
2626+order += "tztime LA"
2727+order += "tztime DC"
2828+order += "tztime local"
2929+# PORT: enable the volume line in the bar. The `volume master` block below was
3030+# defined in the original but never added to `order`, so it never displayed.
3131+# On PipeWire/PulseAudio systems i3status' volume module still works via the
3232+# ALSA compat layer. If it shows nothing, drop this and show volume in a
3333+# separate tool (e.g. wob/swayosd), or switch to i3status-rust.
3434+order += "volume master"
3535+3636+wireless _first_ {
3737+ format_up = "W: (%quality at %essid) %ip"
3838+ format_down = "W: down"
3939+}
4040+4141+ethernet _first_ {
4242+ # if you use %speed, i3status requires root privileges
4343+ format_up = "E: %ip (%speed)"
4444+ format_down = "E: down"
4545+}
4646+4747+battery 0 {
4848+ format = "%status %percentage %remaining"
4949+ status_chr = "⚡"
5050+ status_bat = "🔋"
5151+ status_full = "☻"
5252+ hide_seconds = true
5353+ integer_battery_capacity = true
5454+}
5555+5656+tztime madrid {
5757+ format = "MAD: %H:%M(%a)"
5858+ timezone = "Europe/Madrid"
5959+}
6060+tztime LA {
6161+ format = "SF: %H:%M(%a)"
6262+ timezone = "America/Los_Angeles"
6363+}
6464+tztime DC {
6565+ format = "NY: %H:%M(%a)"
6666+ timezone = "America/New_York"
6767+}
6868+6969+tztime local {
7070+ format = "%a %d %b %H:%M"
7171+ timezone = "Australia/Melbourne"
7272+}
7373+7474+load {
7575+ format = "%1min"
7676+}
7777+7878+disk "/" {
7979+ format = "%avail"
8080+}
8181+8282+volume master {
8383+ format = "♪: %volume"
8484+ format_muted = "♪: X"
8585+ device = "default"
8686+ mixer = "Master"
8787+ mixer_idx = 0
8888+}