diff options
Diffstat (limited to 'home-config/sway/config')
| -rw-r--r-- | home-config/sway/config | 325 |
1 files changed, 325 insertions, 0 deletions
diff --git a/home-config/sway/config b/home-config/sway/config new file mode 100644 index 0000000..28953b8 --- /dev/null +++ b/home-config/sway/config | |||
| @@ -0,0 +1,325 @@ | |||
| 1 | # Ryan's config for sway | ||
| 2 | # | ||
| 3 | # Dependencies: | ||
| 4 | # waybar | ||
| 5 | # fuzzel | ||
| 6 | # light (with proper udev setting for backlight control) | ||
| 7 | # alacritty | ||
| 8 | # swaylock-effects | ||
| 9 | # swayidle | ||
| 10 | # dejavu-fonts-ttf | ||
| 11 | # nerd-fonts-otf | ||
| 12 | # noto-fonts-cjk | ||
| 13 | # mako / libnotify | ||
| 14 | # grim / slurp / wl-clipboard | ||
| 15 | # swaybg | ||
| 16 | # pipewire / pipewire-pulse / pipewire-jack / wireplumber | ||
| 17 | # blueman | ||
| 18 | # spotifyd | ||
| 19 | # syslog-ng | ||
| 20 | # OPTIONAL: wdisplays (monitor layout) | ||
| 21 | # ... | ||
| 22 | |||
| 23 | ### Variables | ||
| 24 | exec sh ~/.profile | ||
| 25 | |||
| 26 | # Load up the user session dbus | ||
| 27 | exec dbus-daemon --session --address=unix:path=$XDG_RUNTIME_DIR/bus | ||
| 28 | |||
| 29 | # | ||
| 30 | # Logo key. Use Mod1 for Alt. | ||
| 31 | set $mod Mod4 | ||
| 32 | # Home row direction keys, like vim | ||
| 33 | set $left h | ||
| 34 | set $down j | ||
| 35 | set $up k | ||
| 36 | set $right l | ||
| 37 | # Your preferred terminal emulator | ||
| 38 | set $term alacritty | ||
| 39 | # Your preferred application launcher | ||
| 40 | # Note: pass the final command to swaymsg so that the resulting window can be opened | ||
| 41 | # on the original workspace that the command was run on. | ||
| 42 | #set $menu bemenu-run --no-exec | xargs swaymsg exec -- | ||
| 43 | set $menu fuzzel --width=35 --font='Hack:weight=bold:size=12' --background-color='282a36fa' --selection-color='3d4460fa' --line-height=20 --border-radius=20 | ||
| 44 | |||
| 45 | # Set lock screen settings | ||
| 46 | set $lock 'swaylock --screenshots --clock --indicator --grace 3 --fade-in 1 --effect-blur 7x5 --effect-greyscale' | ||
| 47 | # Same as above but no grace period | ||
| 48 | set $lock_now 'swaylock --screenshots --clock --indicator --fade-in 1 --effect-blur 7x5 --effect-greyscale' | ||
| 49 | ### Output configuration | ||
| 50 | # | ||
| 51 | # Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/) | ||
| 52 | output * bg ~/Pictures/Wallpapers/mountains.jpg fill | ||
| 53 | # | ||
| 54 | # Example configuration: | ||
| 55 | # | ||
| 56 | # output HDMI-A-1 resolution 1920x1080 position 1920,0 | ||
| 57 | # | ||
| 58 | # You can get the names of your outputs by running: swaymsg -t get_outputs (moved to ~/.config/sway/monitors) | ||
| 59 | |||
| 60 | include ~/.config/sway/monitors | ||
| 61 | |||
| 62 | #output eDP-1 mode 1920x1080@60.008Hz pos 1920 590 | ||
| 63 | #output HDMI-A-1 mode 1920x1080@74.972Hz pos 0 0 | ||
| 64 | |||
| 65 | ### Idle configuration | ||
| 66 | # | ||
| 67 | # Example configuration: | ||
| 68 | # | ||
| 69 | exec swayidle -w \ | ||
| 70 | timeout 300 $lock \ | ||
| 71 | timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ | ||
| 72 | before-sleep 'swaylock -f -c 000000' | ||
| 73 | |||
| 74 | # Winkey+L lock key combo | ||
| 75 | bindsym $mod+l exec $lock_now | ||
| 76 | # | ||
| 77 | #Winkey+Shift+L to lock then go to sleep. zzz must run with no passwd | ||
| 78 | bindsym $mod+Shift+l exec 'swaylock --screenshots --clock --indicator --effect-blur 7x5 --effect-greyscale & sleep 0.5; doas zzz' | ||
| 79 | |||
| 80 | # This will lock your screen after 300 seconds of inactivity, then turn off | ||
| 81 | # your displays after another 300 seconds, and turn your screens back on when | ||
| 82 | # resumed. It will also lock your screen before your computer goes to sleep. | ||
| 83 | |||
| 84 | ### Input configuration | ||
| 85 | # | ||
| 86 | # Example configuration: | ||
| 87 | # | ||
| 88 | # input "2:14:SynPS/2_Synaptics_TouchPad" { | ||
| 89 | # dwt enabled | ||
| 90 | # tap enabled | ||
| 91 | # natural_scroll enabled | ||
| 92 | # middle_emulation enabled | ||
| 93 | # } | ||
| 94 | # | ||
| 95 | # You can get the names of your inputs by running: swaymsg -t get_inputs | ||
| 96 | # Read `man 5 sway-input` for more information about this section. | ||
| 97 | |||
| 98 | gaps inner 10 | ||
| 99 | |||
| 100 | ### Key bindings | ||
| 101 | # | ||
| 102 | # Basics: | ||
| 103 | # | ||
| 104 | # Start a terminal | ||
| 105 | bindsym $mod+Return exec $term | ||
| 106 | |||
| 107 | # Kill focused window | ||
| 108 | bindsym $mod+Shift+q kill | ||
| 109 | |||
| 110 | # Start your launcher | ||
| 111 | bindsym $mod+d exec $menu | ||
| 112 | |||
| 113 | # Drag floating windows by holding down $mod and left mouse button. | ||
| 114 | # Resize them with right mouse button + $mod. | ||
| 115 | # Despite the name, also works for non-floating windows. | ||
| 116 | # Change normal to inverse to use left mouse button for resizing and right | ||
| 117 | # mouse button for dragging. | ||
| 118 | floating_modifier $mod normal | ||
| 119 | |||
| 120 | # Reload the configuration file | ||
| 121 | bindsym $mod+Shift+c reload | ||
| 122 | #Restart your session | ||
| 123 | bindsym $mod+Shift+r restart | ||
| 124 | |||
| 125 | # Exit sway (logs you out of your Wayland session) | ||
| 126 | 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' | ||
| 127 | # | ||
| 128 | # Moving around: | ||
| 129 | # | ||
| 130 | # Move your focus around | ||
| 131 | bindsym $mod+$left focus left | ||
| 132 | bindsym $mod+$down focus down | ||
| 133 | bindsym $mod+$up focus up | ||
| 134 | #bindsym $mod+$right focus right | ||
| 135 | # Or use $mod+[up|down|left|right] | ||
| 136 | bindsym $mod+Left focus left | ||
| 137 | bindsym $mod+Down focus down | ||
| 138 | bindsym $mod+Up focus up | ||
| 139 | bindsym $mod+Right focus right | ||
| 140 | |||
| 141 | # Move the focused window with the same, but add Shift | ||
| 142 | bindsym $mod+Shift+$left move left | ||
| 143 | bindsym $mod+Shift+$down move down | ||
| 144 | bindsym $mod+Shift+$up move up | ||
| 145 | #bindsym $mod+Shift+$right move right | ||
| 146 | # Ditto, with arrow keys | ||
| 147 | bindsym $mod+Shift+Left move left | ||
| 148 | bindsym $mod+Shift+Down move down | ||
| 149 | bindsym $mod+Shift+Up move up | ||
| 150 | bindsym $mod+Shift+Right move right | ||
| 151 | |||
| 152 | # Since I run more than one monitor most of the time, these let me move | ||
| 153 | # workspaces between physical screens | ||
| 154 | bindsym $mod+Control+Shift+Right move workspace to output right | ||
| 155 | bindsym $mod+Control+Shift+Left move workspace to output left | ||
| 156 | # Now I could do the same with up and down but I don't have any of those | ||
| 157 | # | ||
| 158 | # Workspaces: | ||
| 159 | # | ||
| 160 | # Switch to workspace | ||
| 161 | bindsym $mod+1 workspace number 1 | ||
| 162 | bindsym $mod+2 workspace number 2 | ||
| 163 | bindsym $mod+3 workspace number 3 | ||
| 164 | bindsym $mod+4 workspace number 4 | ||
| 165 | bindsym $mod+5 workspace number 5 | ||
| 166 | bindsym $mod+6 workspace number 6 | ||
| 167 | bindsym $mod+7 workspace number 7 | ||
| 168 | bindsym $mod+8 workspace number 8 | ||
| 169 | bindsym $mod+9 workspace number 9 | ||
| 170 | bindsym $mod+0 workspace number 10 | ||
| 171 | # Move focused container to workspace | ||
| 172 | bindsym $mod+Shift+1 move container to workspace number 1 | ||
| 173 | bindsym $mod+Shift+2 move container to workspace number 2 | ||
| 174 | bindsym $mod+Shift+3 move container to workspace number 3 | ||
| 175 | bindsym $mod+Shift+4 move container to workspace number 4 | ||
| 176 | bindsym $mod+Shift+5 move container to workspace number 5 | ||
| 177 | bindsym $mod+Shift+6 move container to workspace number 6 | ||
| 178 | bindsym $mod+Shift+7 move container to workspace number 7 | ||
| 179 | bindsym $mod+Shift+8 move container to workspace number 8 | ||
| 180 | bindsym $mod+Shift+9 move container to workspace number 9 | ||
| 181 | bindsym $mod+Shift+0 move container to workspace number 10 | ||
| 182 | # Note: workspaces can have any name you want, not just numbers. | ||
| 183 | # We just use 1-10 as the default. | ||
| 184 | # | ||
| 185 | # Layout stuff: | ||
| 186 | # | ||
| 187 | # You can "split" the current object of your focus with | ||
| 188 | # $mod+b or $mod+v, for horizontal and vertical splits | ||
| 189 | # respectively. | ||
| 190 | bindsym $mod+b splith | ||
| 191 | bindsym $mod+v splitv | ||
| 192 | |||
| 193 | # Switch the current container between different layout styles | ||
| 194 | bindsym $mod+s layout stacking | ||
| 195 | bindsym $mod+w layout tabbed | ||
| 196 | bindsym $mod+e layout toggle split | ||
| 197 | |||
| 198 | # Make the current focus fullscreen | ||
| 199 | bindsym $mod+f fullscreen | ||
| 200 | |||
| 201 | # Toggle the current focus between tiling and floating mode | ||
| 202 | bindsym $mod+Shift+space floating toggle | ||
| 203 | |||
| 204 | # Swap focus between the tiling area and the floating area | ||
| 205 | bindsym $mod+space focus mode_toggle | ||
| 206 | |||
| 207 | # Move focus to the parent container | ||
| 208 | bindsym $mod+a focus parent | ||
| 209 | |||
| 210 | bindsym $mod+Ctrl+Right focus sibling next | ||
| 211 | |||
| 212 | # | ||
| 213 | # Misc. button bindings | ||
| 214 | # | ||
| 215 | # Some custom keybinds for various keys on my laptop | ||
| 216 | bindsym XF86MonBrightnessUp exec light -A 10 | ||
| 217 | bindsym XF86MonBrightnessDown exec light -U 10 | ||
| 218 | |||
| 219 | # | ||
| 220 | # Scratchpad: | ||
| 221 | # | ||
| 222 | # Sway has a "scratchpad", which is a bag of holding for windows. | ||
| 223 | # You can send windows there and get them back later. | ||
| 224 | |||
| 225 | # Move the currently focused window to the scratchpad | ||
| 226 | bindsym $mod+Shift+minus move scratchpad | ||
| 227 | |||
| 228 | # Show the next scratchpad window or hide the focused scratchpad window. | ||
| 229 | # If there are multiple scratchpad windows, this command cycles through them. | ||
| 230 | bindsym $mod+minus scratchpad show | ||
| 231 | # | ||
| 232 | # Resizing containers: | ||
| 233 | # | ||
| 234 | mode "resize" { | ||
| 235 | # left will shrink the containers width | ||
| 236 | # right will grow the containers width | ||
| 237 | # up will shrink the containers height | ||
| 238 | # down will grow the containers height | ||
| 239 | bindsym $left resize shrink width 10px | ||
| 240 | bindsym $down resize grow height 10px | ||
| 241 | bindsym $up resize shrink height 10px | ||
| 242 | bindsym $right resize grow width 10px | ||
| 243 | |||
| 244 | # Ditto, with arrow keys | ||
| 245 | bindsym Left resize shrink width 10px | ||
| 246 | bindsym Down resize grow height 10px | ||
| 247 | bindsym Up resize shrink height 10px | ||
| 248 | bindsym Right resize grow width 10px | ||
| 249 | |||
| 250 | # Return to default mode | ||
| 251 | bindsym Return mode "default" | ||
| 252 | bindsym Escape mode "default" | ||
| 253 | } | ||
| 254 | bindsym $mod+r mode "resize" | ||
| 255 | |||
| 256 | # | ||
| 257 | # Status Bar: | ||
| 258 | # | ||
| 259 | # Read `man 5 sway-bar` for more information about this section. | ||
| 260 | #bar { | ||
| 261 | # position top | ||
| 262 | # | ||
| 263 | # # When the status_command prints a new line to stdout, swaybar updates. | ||
| 264 | # # The default just shows the current date and time. | ||
| 265 | # status_command while date +'%Y-%m-%d %I:%M:%S %p'; do sleep 1; done | ||
| 266 | # | ||
| 267 | # colors { | ||
| 268 | # statusline #ffffff | ||
| 269 | # background #323232 | ||
| 270 | # inactive_workspace #32323200 #32323200 #5c5c5c | ||
| 271 | # } | ||
| 272 | #} | ||
| 273 | |||
| 274 | bar { | ||
| 275 | swaybar_command waybar | ||
| 276 | } | ||
| 277 | |||
| 278 | exec hash dbus-update-activation-environment 2>/dev/null && dbus-update-activation-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK | ||
| 279 | |||
| 280 | # Numlock on startup | ||
| 281 | input * xkb_numlock enabled | ||
| 282 | |||
| 283 | # Audio Server | ||
| 284 | #exec pipewire | ||
| 285 | #exec wireplumber | ||
| 286 | #exec pipewire-pulse | ||
| 287 | |||
| 288 | # Bluetooth | ||
| 289 | exec blueman-applet | ||
| 290 | |||
| 291 | # Spotifyd | ||
| 292 | #exec spotifyd | ||
| 293 | |||
| 294 | # Notification controls | ||
| 295 | exec mako | ||
| 296 | bindsym $mod+n exec makoctl dismiss | ||
| 297 | bindsym $mod+Shift+n exec makoctl dismiss -a | ||
| 298 | |||
| 299 | # Flameshot position fix and autostart | ||
| 300 | #exec QT_QPA_PLATFORM=wayland flameshot | ||
| 301 | #for_window [app_id="flameshot"] border pixel 0, floating enable, fullscreen disable, move absolute position 0 0 | ||
| 302 | |||
| 303 | # Screenshots to clipboard | ||
| 304 | bindsym $mod+Shift+S exec grim -g "$(slurp)" - | wl-copy -t image/png | ||
| 305 | bindsym $mod+Print exec grim - | wl-copy -t image/png | ||
| 306 | #bindsym $mod+Ctrl+Shift+S exec grim -g "$(slurp)" $(echo "$HOME/Pictures/Screenshot_$(date +'%Y%m%d')_$(date +'%H%M%S').png") | ||
| 307 | bindsym $mod+Ctrl+Print exec grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') - | wl-copy -t image/png | ||
| 308 | |||
| 309 | # Zathura notes window resize | ||
| 310 | for_window [app_id="org.pwmt.zathura" title="^.*notes.pdf$"] resize set width 775 | ||
| 311 | |||
| 312 | # Syncthing start | ||
| 313 | exec syncthing serve --no-browser | ||
| 314 | |||
| 315 | # Force various windows to be floating | ||
| 316 | # Firefox PIP YT Player | ||
| 317 | for_window [app_id="firefox-default" title="^Picture-in-Picture$"] floating enable, resize set 578 326, border none, sticky enable | ||
| 318 | # Duo 2FA | ||
| 319 | for_window [app_id="firefox-default" title="^Activate Security Key — Mozilla Firefox$"] floating enable | ||
| 320 | for_window [app_id="firefox-default" title="^Nightly — Sharing Indicator$"] floating enable, resize set 18 52, border none, move position center, move y 0px | ||
| 321 | # Qjackctl | ||
| 322 | for_window [app_id="qjackctl"] floating enable | ||
| 323 | # Weather Window | ||
| 324 | for_window [app_id="ala-wttr"] border none, floating enable, resize set 740 712 | ||
| 325 | include /etc/sway/config.d/* | ||
