8.1 KiB
Sway Configuration
Variables
Use super
as modifier key.
set $mod Mod4
Use vi
motions as directional inputs.
set $left h
set $down j
set $up k
set $right l
Use foot
as default terminal.
set $term foot
Use wofi
as app launcher.
set $menu fuzzel
Startup Application
Use dbus
environment.
exec --no-startup-id dbus-update-activation-environment --all
Use mako
as notification daemon.
exec mako
Launch PipeWire without systemd
.
exec gentoo-pipewire-launcher &
Launch blueman-applet
as Bluetooth daemon.
exec blueman-applet
Launch music player daemon.
exec mpd
Launch mpdscribble
as scrobbler daemon.
exec mpdscribble
Launch Emacs daemon.
exec emacs --daemon
Display
I use a vertical monitor on the left and horizontal monitor on the right.
output HDMI-A-1 resolution 1920x1080 position 1080 140
output HDMI-A-2 resolution 1920x1080 transform 90 position 0 0
Use the file at ~/.wallpaper
as my wallpaper.
output * bg ~/.wallpaper fill
Remove borders from windows.
default_border none
default_floating_border none
font pango:monospace 1
Use 10 pixel gaps.
gaps inner 10
Use waybar
as a top bar.
bar {
position top
status_command waybar
mode invisible
}
Input
Use pointer acceleration.
input * {
accel_profile "adaptive"
pointer_accel -.5
}
Controls
Add ability to lock the screen with swaylock
. Turn off the screen after 15 seconds on lock screen.
bindsym $mod+Control+l exec swaylock --ignore-empty-password --show-failed-attempts --image ~/.wallpaper
exec swayidle -w timeout 15 'if pgrep -x swaylock; then swaymsg "output * power off"; fi' resume 'swaymsg "output * power on"'
Add keybinding to open a terminal emulator.
bindsym $mod+Return exec $term
Add keybinding for killing a window.
bindsym $mod+Shift+q kill
Add keybinding for opening an app launcher.
bindsym $mod+d exec $menu
Holding the modifier key allows moving a window.
floating_modifier $mod normal
Add keybinding for reloading the configuration.
bindsym $mod+Shift+c reload
Add keybinding to launch logout/power off/restart prompt which also activates with the power key.
bindsym $mod+Shift+e exec bash ~/.config/sway/powerprompt
bindsym XF86PowerOff exec bash ~/.config/sway/powerprompt
Change focus keybindings.
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
Move window keybindings.
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
Change workspace keybindings.
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10
Move window to workspace keybindings.
bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
bindsym $mod+Shift+4 move container to workspace number 4
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
Set split direction keybindings.
bindsym $mod+v splith
bindsym $mod+s splitv
Toggle layout keybindings.
bindsym $mod+e layout toggle split
Define full screen keybinding.
bindsym $mod+f fullscreen
Define toggle floating keybinding.
bindsym $mod+Shift+space floating toggle
Move focus between floating and tiled layer keybinding.
bindsym $mod+space focus mode_toggle
Focus on the parent window keybinding.
bindsym $mod+a focus parent
Keybindings to move a window to the scratchpad and back from it.
bindsym $mod+Shift+minus move scratchpad
bindsym $mod+minus scratchpad show
Add resize keybindings.
mode "resize" {
bindsym $left resize shrink width 10px
bindsym $down resize grow height 10px
bindsym $up resize shrink height 10px
bindsym $right resize grow width 10px
bindsym Left resize shrink width 10px
bindsym Down resize grow height 10px
bindsym Up resize shrink height 10px
bindsym Right resize grow width 10px
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
Add screenshot keybinding.
bindsym $mod+Shift+s exec grim -g "$(slurp)" - | wl-copy
Add volume keybindings.
bindsym XF86AudioRaiseVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
bindsym XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
bindsym XF86AudioMute exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
Add pause keybinding.
bindsym XF86Eject exec mpc toggle
Extras
Load extra configuration.
include /etc/sway/config.d/*