dotfiles/wm/.config/sway/config

257 lines
8.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ericonr's config for sway
## Defaults
set $term alacritty
set $menu launcher
set $editor emacs
## Set keyboard controls
# Logo key
set $mod Mod4
# Change focus like VIM
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# You can also use the cursor keys
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# Move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
# You can also use the cursor keys
bindsym $mod+Shift+Left move workspace to left
bindsym $mod+Shift+Down move workspace to down
bindsym $mod+Shift+Up move workspace to up
bindsym $mod+Shift+Right move workspace to right
## System tasks
# Reload configuration file
bindsym $mod+Shift+c reload
# Restart sway inplace (can be used to upgrade sway)
bindsym $mod+Shift+r restart
# Exit sway
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut.' -b 'Exit session' 'swaymsg exit' -b 'Suspend device' 'systemctl suspend' -b 'Shut down' 'poweroff'
## Input settings
# Change keyboard layout
set $keyboard "1:1:AT_Translated_Set_2_keyboard"
input $keyboard {
xkb_layout "us,br"
xkb_options ctrl:nocaps
}
bindsym $mod+Space exec keyboard_layout_switcher
# Touchpad
set $touchpad "1739:31251:SYNA2393:00_06CB:7A13_Touchpad"
input $touchpad {
tap enabled
natural_scroll disabled
}
# Media keys
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
bindsym XF86AudioPlay exec playerctl play-pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
bindsym XF86MonBrightnessDown exec brightnessctl set 5%-
bindsym XF86MonBrightnessUp exec brightnessctl set +5%
# Cursor theme
seat * xcursor_theme Breeze_Snow
# Screenshots
bindsym Print exec screenshot
bindsym Ctrl+Print exec screenshot COPY
bindsym Shift+Print exec screenshot CROP
bindsym Ctrl+Shift+Print exec screenshot CROP COPY
## Launching applications
# Start a terminal
bindsym $mod+Return exec $term
# Start a terminal with tmux
bindsym $mod+t exec $term -e start-tmux
# Start a terminal with music tmux
bindsym $mod+Mod1+m exec $term -e start-tmux-music
# Launch editor
bindsym $mod+Shift+w exec $editor
# Start Dolphin file browser
bindsym $mod+Shift+f exec dolphin
# Kill focused window
bindsym $mod+Shift+q kill
# Start launcher
bindsym $mod+d exec $menu
for_window [title="launcher"] focus, floating enable, border none
# Drag floating windows by holding down $mod and left mouse button.
# Resize them with right mouse button + $mod.
# Despite the name, also works for non-floating windows.
# Change normal to inverse to use left mouse button for resizing and right
# mouse button for dragging.
floating_modifier $mod normal
## Enable further services for complete session
# Polkit authenticator
exec /usr/lib/polkit-kde-authentication-agent-1
for_window [app_id="polkit"] focus, floating enable, border pixel 4
# Notifications daemon
exec mako
## Appearance
# Default wallpaper
output * bg ~/Pictures/wallpaper.png fill
# Font for window titles
font pango:Liberation Sans 9
# Gaps configuration
default_border none
gaps outer 3
gaps inner 3
# Redshift
exec redshift
## Idle configuration
# Automatic behavior
exec swayidle -w \
timeout 300 'swaylock' \
timeout 600 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' \
before-sleep 'swaylock'
# Manual behavior
bindsym $mod+Shift+x exec swaylock -f -c 000000
## Layout
# Split in horizontal orientation
bindsym $mod+g splith
# Split in vertical orientation
bindsym $mod+v splitv
# Enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# Change container layout (stacked, tabbed, toggle split)
bindsym $mod+q layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# Toggle the current focus between tiling and floating mode
bindsym $mod+Shift+z floating toggle
# Swap focus between the tiling area and the floating area
bindsym $mod+z focus mode_toggle
# Move focys to the parent container
bindsym $mod+a focus parent
# Move focus to the child container
bindsym $mod+Shift+a focus child
## Workspaces
# Workspace name
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
set $wsb "browser"
set $wsn "nth"
set $wsm "media"
set $wso "oh"
set $wsp "pdf"
# Switch to workspace
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
bindsym $mod+9 workspace $ws9
bindsym $mod+0 workspace $ws10
bindsym $mod+b workspace $wsb
bindsym $mod+n workspace $wsn
bindsym $mod+m workspace $wsm
bindsym $mod+o workspace $wso
bindsym $mod+p workspace $wsp
# Move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9
bindsym $mod+Shift+0 move container to workspace $ws10
bindsym $mod+Shift+b move container to workspace $wsb
bindsym $mod+Shift+n move container to workspace $wsn
bindsym $mod+Shift+m move container to workspace $wsm
bindsym $mod+Shift+o move container to workspace $wso
bindsym $mod+Shift+p move container to workspace $wsp
## Scratchpad
# Sway has a "scratchpad", which is a bag of holding for windows.
# You can send windows there and get them back later.
# Move the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+minus scratchpad show
## Resizing containers
mode "resize" {
# Pressing left will shrink the windows width
# Pressing right will grow the windows width
# Pressing up will shrink the windows height
# Pressing down will grow the windows height
bindsym h resize shrink width 5px
bindsym j resize grow height 5px
bindsym k resize shrink height 5px
bindsym l resize grow width 5px
# Same bindings, but for the arrow keys
bindsym Left resize shrink width 5 px or 5 ppt
bindsym Down resize grow height 5 px or 5 ppt
bindsym Up resize shrink height 5 px or 5 ppt
bindsym Right resize grow width 5 px or 5 ppt
# Back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"
## Status bar
bar {
id mainbar
position top
mode hide
hidden_state hide
swaybar_command waybar
}
for_window [app_id="waybar" floating] {
move position cursor
move down 120px # adjust if some menus still don't fit
}
## Pre-configured workspaces
# Music
exec swaymsg 'workspace media; layout tabbed'
for_window [app_id="spotify"] move container to workspace $wsm
# Work
exec swaymsg 'workspace nth; layout tabbed'
assign [app_id="Kicad"] $wsn
assign [title="CubeMX"] $wsn
# PDF
exec swaymsg 'workspace pdf; layout tabbed'
assign [app_id="okular"] $wsp
# Return to first workspace
exec swaymsg 'workspace 1;'
## Application specific settings
for_window [app_id="krunner"] floating enable
for_window [app_id="konsole"] floating enable
for_window [app_id="pavucontrol"] focus, floating enable
for_window [app_id="org.mozilla.plasma-browser-integration-host"] floating enable