275 lines
9.0 KiB
Plaintext

#### -*-conf-space-*- ####
## Global Sway Config File ##
#### ####
# This config file is global, anything in this file should work on all devices.
# Any device-specific configuration should be placed in one of these drop-in
# locations:
# - `display-arrangement.conf` -- display arrangement
# - `workspace-arrangement.conf` -- workspace arrangement
# - `input.conf` -- input configuration (most devices should use the ##default variant)
# - `local-config.d/*.conf` -- additional device-specific configuration files
# These files should be symlinks managed by `yadm`.
### ###
# Set Variables #
### ###
set $mod Mod4
set $alt Mod1
set $colorprimary '#815986'
set $colorbackground '#2d272f'
set $colorwallpaper '#1e1e1e'
## ##
# Configure displays and workspaces #
## ##
## Set Background
output * bg '#1e1e1e' solid_color
## Include Device-Specific Configs
#include display-arrangement.conf
#include workspace-arrangement.conf
### ###
# Window Management Keybinds #
### ###
floating_modifier $mod
## Resize Mode
mode "resize" {
bindsym {
# Arrow key bindings
Left resize shrink width 10 px or 1 ppt
Right resize grow width 10 px or 1 ppt
Up resize shrink height 10 px or 1 ppt
Down resize grow height 10 px or 1 ppt
# Emacs bindings
$mod+b resize shrink width 10 px or 1 ppt
$mod+f resize grow width 10 px or 1 ppt
$mod+p resize shrink height 10 px or 1 ppt
$mod+n resize grow height 10 px or 1 ppt
# Escape bindings
Return mode "default"
Escape mode "default"
$mod+r mode "default"
}
}
## Workspace Switching Keybinds
bindsym {
$mod+1 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 1
$mod+2 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 2
$mod+3 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 3
$mod+4 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 4
$mod+5 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 5
$mod+6 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 6
$mod+7 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 7
$mod+8 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 8
$mod+9 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 9
$mod+0 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 10
}
## Window Reassignment Keybinds
bindsym {
$mod+Shift+1 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 1
$mod+Shift+2 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 2
$mod+Shift+3 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 3
$mod+Shift+4 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 4
$mod+Shift+5 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 5
$mod+Shift+6 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 6
$mod+Shift+7 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 7
$mod+Shift+8 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 8
$mod+Shift+9 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 9
$mod+Shift+0 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 10
}
bindsym $mod+r mode "resize"
## Moving Windows
bindsym {
# Arrow key bindings
$mod+Shift+Left move left
$mod+Shift+Right move right
$mod+Shift+Up move up
$mod+Shift+Down move down
# Emacs bindings
$mod+Shift+b move left
$mod+Shift+f move right
$mod+Shift+p move up
$mod+Shift+n move down
}
## Shifting Focus
bindsym {
# Arrow key bindings
$mod+Left focus left
$mod+Right focus right
$mod+Up focus up
$mod+Down focus down
# Emacs bindings
$mod+b focus left
$mod+f focus right
$mod+p focus up
$mod+n focus down
# Arrow key output bindings
$mod+Control+Left focus output left
$mod+Control+Right focus output right
$mod+Control+Up focus output up
$mod+Control+Down focus output down
# Emacs output bindings
$mod+Control+b focus output left
$mod+Control+f focus output right
$mod+Control+p focus output up
$mod+Control+n focus output down
}
## Containers
bindsym {
# Create new containers
$mod+h split h
$mod+v split v
# Rearrange current container
$mod+e layout toggle split
$mod+t layout tabbed
$mod+s layout stacking
# Focus parent container
$mod+a focus parent
# Focus child container
$mod+q focus child
}
## Close focused window
bindsym $mod+Shift+q kill
## Floating and Fullscreen
bindsym $mod+Space focus mode_toggle
bindsym $mod+Shift+Space floating toggle
bindsym $mod+$alt+f fullscreen toggle
bindsym $mod+$alt+Shift+f fullscreen global
### ###
# Style Configuration #
### ###
## Font
font pango:JetBrainsMono Nerd Font 8
## Borders
default_border pixel 1
## Colors
client.focused $colorprimary $colorbackground $colorprimary $colorprimary $colorprimary
client.focused_inactive $colorbackground $colorbackground $colorprimary $colorbackground $colorbackground
client.unfocused $colorwallpaper $colorwallpaper $colorprimary $colorbackground $colorbackground
## Window gaps
gaps inner 10
## GTK theme
exec_always gsettings set org.gnome.desktop.interface {
gtk-theme 'Nordic-darker'
icon-theme 'ePapirus-dark'
font-name 'JetBrainsMono NF:12'
}
## Terminals
for_window [app_id="Alacritty"] {
border normal 1
client.focused $colorprimary $colorbackground $colorprimary $colorprimary $colorprimary
client.focused_inactive $colorbackground $colorbackground $colorprimary $colorbackground $colorbackground
client.unfocused $colorbackground $colorwallpaper $colorprimary $colorbackground $colorbackground
}
## Floating windows should have titles
for_window [floating] border normal 1
## Thunderbird New.* windows should float
for_window [app_id="thunderbird" title="(New|Write)"] floating enable
## Bitwarden extension windows should float by default
for_window [app_id="firefox" title="Extension: \(Bitwarden Password Manager\)"] floating enable
## Kwallet popup prompts should float
for_window [app_id="rg.kde.kwalletd6"] floating enable
### ###
# Application Keybinds #
### ###
## Reload Sway
bindsym $mod+Shift+r reload
## Default Application Launcher
bindsym $mod+Return exec default-application-launcher
## Terminal Launcher
bindsym $mod+Shift+Return exec alacritty msg create-window || alacritty
## Program Menu
bindsym $mod+d exec wofi --show drun
## Media Controls
bindsym --locked {
XF86AudioPlay exec playerctl play-pause
XF86AudioNext exec playerctl next
XF86AudioPrev exec playerctl previous
XF86AudioRaiseVolume exec pactl set-sink-volume @DEFUALT_SINK@ +5%
XF86AudioLowerVolume exec pactl set-sink-volume @DEFUALT_SINK@ -5%
XF86AudioMute exec pactl set-sink-mute @DEFUALT_SINK@ toggle
}
## Screen Locking
bindsym $mod+l exec loginctl lock-session
## Notifications
bindsym $mod+Ctrl+Space exec swaync-client --hide-latest
bindsym Ctrl+Shift+Space exec swaync-client -t
## Screenshotting
bindsym {
Shift+Print exec grimshot copy window && notify-send -a 'Screenshot' -u low 'Screenshot taken' 'An image of the selected window has been copied to clipboard'
Ctrl+Print exec grimshot copy area && notify-send -a 'Screenshot' -u low 'Screenshot taken' 'An image of the selected area has been copied to clipboard'
Print exec grimshot copy screen && notify-send -a 'Screenshot' -u low 'Screenshot taken' 'An image of the entire screen has been copied to clipboard'
Mod1+Print exec grimshot copy output && notify-send -a 'Screenshot' -u low 'Screenshot taken' 'An image of the focused output has been copied to clipboard'
}
### ###
# Input Configuration #
### ###
include input.conf
### ###
# Service Management #
### ###
## Import Environment Variables
exec_always XDG_CURRENT_DESKTOP=sway {
systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP PATH ASDF_DATA_DIR
dbus-update-activation-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP PATH ASDF_DATA_DIR
}
## Start Session Target
exec_always systemctl --user start sway-session.target
### ###
# Generic Local Configuration #
### ###
## Include any relevant files from local-config.d/
include local-config.d/*.conf