dotfiles
1

Configure Feed

Select the types of activity you want to include in your feed.

Add sway configuration based on old i3 config

Juan Nunez-Iglesias (Jun 28, 2026, 4:33 PM +0200) 9bbd23a3 7759bd62

+343
+255
sway/config
··· 1 + set $mod Mod4 2 + 3 + # Font for window titles. Also used by the bar unless overridden in its block. 4 + font pango:DejaVu Sans Mono 12 5 + 6 + # PORT: name the apps once and reference them below. 7 + # Terminal is Ghostty (configured elsewhere in these dotfiles). 8 + set $term ghostty 9 + # PORT: dmenu is X11-only. wofi is a common Wayland launcher (drun = .desktop apps). 10 + # Alternatives: bemenu-run, wmenu-run (sway's modern default), fuzzel. 11 + set $menu wofi --show drun 12 + 13 + # Use Mouse+$mod to drag floating windows to their wanted position 14 + floating_modifier $mod 15 + 16 + # start a terminal 17 + # PORT: was `exec i3-sensible-terminal` 18 + bindsym $mod+Return exec $term 19 + 20 + # kill focused window 21 + bindsym $mod+Shift+apostrophe kill 22 + 23 + # start a program launcher 24 + bindsym $mod+d exec $menu 25 + # There also is the (new) i3-dmenu-desktop which only displays applications 26 + # shipping a .desktop file. It is a wrapper around dmenu, so you need that 27 + # installed. 28 + # bindsym $mod+d exec --no-startup-id i3-dmenu-desktop 29 + 30 + # alternatively, you can use the cursor keys: 31 + bindsym $mod+Left focus left 32 + bindsym $mod+Down focus down 33 + bindsym $mod+Up focus up 34 + bindsym $mod+Right focus right 35 + 36 + 37 + # alternatively, you can use the cursor keys: 38 + bindsym $mod+Shift+Left move left 39 + bindsym $mod+Shift+Down move down 40 + bindsym $mod+Shift+Up move up 41 + bindsym $mod+Shift+Right move right 42 + 43 + # move workspaces 44 + bindsym Mod4+Control+Left workspace prev 45 + bindsym Mod4+Control+Right workspace next 46 + bindsym Mod4+Control+Shift+Left move container to workspace prev 47 + bindsym Mod4+Control+Shift+Right move container to workspace next 48 + 49 + # split in horizontal orientation 50 + bindsym $mod+h split h 51 + 52 + # split in vertical orientation 53 + bindsym $mod+v split v 54 + 55 + # enter fullscreen mode for the focused container 56 + bindsym $mod+f fullscreen toggle 57 + 58 + # change container layout (stacked, tabbed, splitv) 59 + bindsym $mod+s layout stacking 60 + bindsym $mod+t layout tabbed 61 + bindsym $mod+e layout splitv 62 + 63 + # toggle tiling / floating 64 + bindsym $mod+Shift+space floating toggle 65 + 66 + # change focus between tiling / floating windows 67 + bindsym $mod+space focus mode_toggle 68 + 69 + # enable imagej floating 70 + for_window [title="\(Fiji Is Just\) ImageJ"] floating enable 71 + 72 + # focus the parent container 73 + bindsym $mod+a focus parent 74 + 75 + # focus the child container 76 + #bindsym $mod+d focus child 77 + 78 + # switch to workspace 79 + bindsym $mod+1 workspace number 1 80 + bindsym $mod+2 workspace number 2 81 + bindsym $mod+3 workspace number 3 82 + bindsym $mod+4 workspace number 4 83 + bindsym $mod+5 workspace number 5 84 + bindsym $mod+6 workspace number 6 85 + bindsym $mod+7 workspace number 7 86 + bindsym $mod+8 workspace number 8 87 + bindsym $mod+9 workspace number 9 88 + bindsym $mod+0 workspace number 10 89 + 90 + # move focused container to workspace 91 + bindsym $mod+Shift+1 move container to workspace number 1, workspace number 1 92 + bindsym $mod+Shift+2 move container to workspace number 2, workspace number 2 93 + bindsym $mod+Shift+3 move container to workspace number 3, workspace number 3 94 + bindsym $mod+Shift+4 move container to workspace number 4, workspace number 4 95 + bindsym $mod+Shift+5 move container to workspace number 5, workspace number 5 96 + bindsym $mod+Shift+6 move container to workspace number 6, workspace number 6 97 + bindsym $mod+Shift+7 move container to workspace number 7, workspace number 7 98 + bindsym $mod+Shift+8 move container to workspace number 8, workspace number 8 99 + bindsym $mod+Shift+9 move container to workspace number 9, workspace number 9 100 + bindsym $mod+Shift+0 move container to workspace number 10, workspace number 10 101 + 102 + # rename current workspace 103 + # PORT: i3-input is X11-only. sway has no built-in input prompt; this uses a 104 + # small helper. If you don't have one, install e.g. `swayrename` or replace the 105 + # prompt with wofi/bemenu. Original line kept below for reference. 106 + # bindsym $mod+n exec i3-input -F 'rename workspace to "%s"' -P 'New name: ' -f "pango:DejaVu Sans Mono 32" 107 + bindsym $mod+n exec swaymsg rename workspace to "$(echo '' | wofi --dmenu -p 'New name:')" 108 + 109 + # reload the configuration file 110 + bindsym $mod+Shift+c reload 111 + # OBSOLETE: i3's `restart` does an X11 in-place restart; sway has no equivalent. 112 + # `reload` (above) already re-reads the config. Original kept for reference. 113 + # bindsym $mod+Shift+r restart 114 + # exit sway (logs you out of your Wayland session) 115 + # PORT: i3-nagbar -> swaynag, i3-msg -> swaymsg 116 + 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' 117 + 118 + # startup programs 119 + exec --no-startup-id nm-applet --indicator 120 + exec --no-startup-id dropbox start 121 + 122 + # keyboard and trackpad settings 123 + input "type:keyboard" { 124 + xkb_layout us,us 125 + xkb_variant dvorak, 126 + # grp:shifts_toggle = press both Shifts together to switch layout 127 + # (dvorak <-> qwerty). Works on the swaylock screen too, since it's xkb-level. 128 + xkb_options grp:shifts_toggle,compose:prsc,caps:escape,altwin:swap_lalt_lwin 129 + } 130 + 131 + # PORT: synclient/syndaemon are the old X11 synaptics driver, replaced by 132 + # libinput. Configure the touchpad with a sway input block instead. 133 + # Original: synclient PalmDetect=1 HorizTwoFingerScroll=1 VertScrollDelta=-243 \ 134 + # HorizScrollDelta=-243 TapButton1=0 (negative deltas = natural scroll, 135 + # TapButton1=0 = tap-to-click disabled) 136 + # Original: syndaemon -i 0.5 -K -t (ignore taps while typing -> dwt) 137 + input "type:touchpad" { 138 + # tap disabled 139 + natural_scroll enabled 140 + scroll_method two_finger 141 + dwt enabled 142 + } 143 + 144 + # PORT: feh is X11-only; sway sets wallpapers natively via `output`. 145 + # Original: exec feh --bg-fill /usr/share/backgrounds/Halifax_Sunset_by_Vlad_Drobinin.jpg 146 + output * bg /usr/share/backgrounds/cosmic/orion_nebula_nasa_heic0601a.jpg fill 147 + 148 + # Audio controls. 149 + # PORT: switched from pactl-with-hardcoded-sink-0 to wpctl (native PipeWire 150 + # tool, already installed). @DEFAULT_AUDIO_SINK@ follows the real default sink, 151 + # so this keeps working across HDMI/Bluetooth/dock changes. -l 1.0 caps volume 152 + # at 100% so RaiseVolume can't push past it. 153 + # Original: pactl set-sink-mute 0 0 && pactl set-sink-volume 0 +5% 154 + # pactl set-sink-mute 0 0 && pactl set-sink-volume 0 -5% 155 + # pactl set-sink-mute 0 toggle 156 + bindsym XF86AudioRaiseVolume exec wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%+ 157 + bindsym XF86AudioLowerVolume exec wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%- 158 + bindsym XF86AudioMute exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle 159 + 160 + # Screen brightness controls. 161 + # PORT: switched from `light` (not installed; setuid-based) to brightnessctl, 162 + # which talks to systemd-logind and so works in the active sway session without 163 + # the video group or a setuid bit -- the same logind path COSMIC used natively. 164 + # Install with: sudo apt install brightnessctl 165 + # Original: light -A 10 / light -U 10 166 + bindsym XF86MonBrightnessUp exec brightnessctl set 10%+ # increase screen brightness 167 + bindsym XF86MonBrightnessDown exec brightnessctl set 10%- # decrease screen brightness 168 + 169 + # Screen lock (plain swaylock -- no effects fork needed). 170 + # PORT: replaces the old X11 i3lock-based ~/scripts/fuzzy-lock.sh. 171 + # Original: bindsym Control+Mod4+l exec "~/scripts/fuzzy-lock.sh" 172 + # 173 + # swaylock uses the ext-session-lock-v1 protocol: the compositor keeps the 174 + # screen locked even if the locker crashes, so it fails secure. 175 + # 176 + # No blur (that needs the unmaintained swaylock-effects fork). Instead we use 177 + # the same nebula wallpaper as the desktop, scaled to fill, with a themed 178 + # indicator ring that changes colour by state: idle=purple, typing-highlight= 179 + # bright purple, backspace=red, verifying=amber, wrong=red, cleared=green. 180 + # Colours are RRGGBBAA hex without a leading '#'. 181 + # $lock is defined once and reused by the hotkey and swayidle below. 182 + set $lock swaylock -f \ 183 + --image /usr/share/backgrounds/cosmic/orion_nebula_nasa_heic0601a.jpg \ 184 + --scaling fill \ 185 + --font "DejaVu Sans Mono" \ 186 + --indicator-radius 110 \ 187 + --indicator-thickness 8 \ 188 + --indicator-caps-lock \ 189 + --show-failed-attempts \ 190 + --show-keyboard-layout \ 191 + --inside-color 1e1e2ecc \ 192 + --inside-clear-color 1e2e1ecc \ 193 + --inside-ver-color 2e2a1ecc \ 194 + --inside-wrong-color 2e1e1ecc \ 195 + --ring-color 7c5cbfff \ 196 + --ring-clear-color a3be8cff \ 197 + --ring-ver-color ebcb8bff \ 198 + --ring-wrong-color bf616aff \ 199 + --key-hl-color 9d7cffff \ 200 + --bs-hl-color bf616aff \ 201 + --line-uses-ring \ 202 + --separator-color 00000000 \ 203 + --text-color e0def4ff \ 204 + --text-clear-color e0def4ff \ 205 + --text-ver-color e0def4ff \ 206 + --text-wrong-color e0def4ff 207 + 208 + # Manual lock 209 + bindsym Control+Mod4+l exec $lock 210 + 211 + # Auto-lock + display power management. 212 + # - lock after 5 min idle 213 + # - blank the outputs after 10 min (and restore on activity) 214 + # - always lock right before the system suspends, so it's locked on resume 215 + exec swayidle -w \ 216 + timeout 300 '$lock' \ 217 + timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ 218 + before-sleep '$lock' 219 + 220 + # resize window (you can also use the mouse for that) 221 + mode "resize" { 222 + # These bindings trigger as soon as you enter the resize mode 223 + 224 + # Pressing left will shrink the window’s width. 225 + # Pressing right will grow the window’s width. 226 + # Pressing up will shrink the window’s height. 227 + # Pressing down will grow the window’s height. 228 + bindsym h resize shrink width 5 px or 5 ppt 229 + bindsym t resize grow height 5 px or 5 ppt 230 + bindsym n resize shrink height 5 px or 5 ppt 231 + bindsym s resize grow width 5 px or 5 ppt 232 + 233 + # same bindings, but for the arrow keys 234 + bindsym Left resize shrink width 5 px or 5 ppt 235 + bindsym Down resize shrink height 5 px or 5 ppt 236 + bindsym Up resize grow height 5 px or 5 ppt 237 + bindsym Right resize grow width 5 px or 5 ppt 238 + 239 + # back to normal: Enter or Escape 240 + bindsym Return mode "default" 241 + bindsym Escape mode "default" 242 + } 243 + 244 + bindsym $mod+r mode "resize" 245 + 246 + # Start swaybar to display a workspace bar (plus i3status' system information). 247 + # i3status is compositor-agnostic and works under sway unchanged. 248 + bar { 249 + status_command i3status -c ~/.config/sway/i3status.conf 250 + tray_output primary 251 + } 252 + 253 + # Make sure apps and the tray see the Wayland/desktop environment. 254 + # PORT: needed so xdg-desktop-portal, the tray, and dbus-activated apps work. 255 + exec --no-startup-id dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
+88
sway/i3status.conf
··· 1 + # i3status configuration file, used by the sway `bar` block. 2 + # see "man i3status" for documentation. 3 + # 4 + # i3status is compositor-agnostic (it reads /sys and /proc), so this works 5 + # unchanged under sway. Porting markers: 6 + # # PORT: adjusted for a modern Wayland/PipeWire setup 7 + # # OBSOLETE: kept for reference but redundant/unsupported on a current system 8 + # 9 + # It is important that this file is edited as UTF-8. 10 + # The following line should contain a sharp s: 11 + # ß 12 + # If the above line is not correctly displayed, fix your editor first! 13 + 14 + general { 15 + colors = true 16 + interval = 5 17 + } 18 + 19 + order += "ipv6" 20 + order += "disk /" 21 + order += "wireless _first_" 22 + order += "ethernet _first_" 23 + order += "battery 0" 24 + order += "load" 25 + order += "tztime madrid" 26 + order += "tztime LA" 27 + order += "tztime DC" 28 + order += "tztime local" 29 + # PORT: enable the volume line in the bar. The `volume master` block below was 30 + # defined in the original but never added to `order`, so it never displayed. 31 + # On PipeWire/PulseAudio systems i3status' volume module still works via the 32 + # ALSA compat layer. If it shows nothing, drop this and show volume in a 33 + # separate tool (e.g. wob/swayosd), or switch to i3status-rust. 34 + order += "volume master" 35 + 36 + wireless _first_ { 37 + format_up = "W: (%quality at %essid) %ip" 38 + format_down = "W: down" 39 + } 40 + 41 + ethernet _first_ { 42 + # if you use %speed, i3status requires root privileges 43 + format_up = "E: %ip (%speed)" 44 + format_down = "E: down" 45 + } 46 + 47 + battery 0 { 48 + format = "%status %percentage %remaining" 49 + status_chr = "⚡" 50 + status_bat = "🔋" 51 + status_full = "☻" 52 + hide_seconds = true 53 + integer_battery_capacity = true 54 + } 55 + 56 + tztime madrid { 57 + format = "MAD: %H:%M(%a)" 58 + timezone = "Europe/Madrid" 59 + } 60 + tztime LA { 61 + format = "SF: %H:%M(%a)" 62 + timezone = "America/Los_Angeles" 63 + } 64 + tztime DC { 65 + format = "NY: %H:%M(%a)" 66 + timezone = "America/New_York" 67 + } 68 + 69 + tztime local { 70 + format = "%a %d %b %H:%M" 71 + timezone = "Australia/Melbourne" 72 + } 73 + 74 + load { 75 + format = "%1min" 76 + } 77 + 78 + disk "/" { 79 + format = "%avail" 80 + } 81 + 82 + volume master { 83 + format = "♪: %volume" 84 + format_muted = "♪: X" 85 + device = "default" 86 + mixer = "Master" 87 + mixer_idx = 0 88 + }