dotfiles/wayland/.config/sway/config

302 lines
9.7 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.

# _
# ___ _ __ (_) ___ ___ _ __ _ __
# / _ \| '__|| | / __| / _ \ | '_ \ | '__|
# | __/| | | || (__ | (_) || | | || |
# \___||_| |_| \___| \___/ |_| |_||_|
#
## Defaults
set $term alacritty
set $menu nwgdmenu
set $fallback_menu launcher
set $editor quickedit
set $file_manager generic-launcher ranger
## 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
# Exit sway
bindsym $mod+Shift+e exec sway_exit_prompt
## Input settings
input type:keyboard {
xkb_layout "us,br"
xkb_options ctrl:nocaps
}
input type:touchpad {
tap enabled
natural_scroll disabled
scroll_factor 0.8 # help Firefox work correctly
}
bindsym $mod+Space exec keyboard_layout_switcher
# Cursor theme
seat * xcursor_theme Breeze_Snow
# Media keys
bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym --locked XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym --locked XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
bindsym --locked XF86AudioPlay exec pctl play-pause
bindsym --locked XF86AudioNext exec pctl next
bindsym --locked XF86AudioPrev exec pctl previous
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
bindsym --locked XF86MonBrightnessUp exec brightnessctl set +5%
# 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
# AppPauser
bindsym $mod+Ctrl+P exec apppauserctl toggle
bindsym $mod+Ctrl+G exec firejail --join=steam apppauserctl toggle
## Launching applications
# Start a terminal
bindsym $mod+Return exec $term
# Start a floating terminal
bindsym $mod+Shift+Return exec generic-launcher
# Start a terminal with tmux
bindsym $mod+t exec $term -e start-tmux
# Start a terminal with music tmux
bindsym $mod+Mod1+m exec generic-launcher start-tmux-music
# Start launcher
bindsym $mod+Shift+d exec $fallback_menu
# Rule for almost everything inside launcher
for_window [app_id="generic-launcher"] focus, floating enable, border none, resize set height 80ppt, resize set width 70ppt
# Start MPV with clipboard as arg
bindsym $mod+Mod1+p exec youtube-mpv
# Launch editor
bindsym $mod+Mod1+e exec $editor
# Start Dolphin file browser
bindsym $mod+Mod1+f exec $file_manager
# Open iwctl dialog
bindsym $mod+Mod1+i exec quickiwctl
# Dismiss all mako notifications
bindsym $mod+Mod1+n exec makoctl dismiss -a
# Kill focused window
bindsym $mod+Shift+q kill
# Start wofi
bindsym $mod+d exec $menu
# Drag windows by holding down $mod and left mouse button.
# Resize windows with right mouse button + $mod.
floating_modifier $mod normal
## Appearance
# Default wallpaper
output * bg ~/Pictures/wallpaper.png fill
# Font for window titles
font pango:Liberation Sans 9
# Gaps configuration
smart_gaps on
smart_borders on
#default_border none
gaps outer 3
gaps inner 3
# Hide Title Bars
for_window [app_id="^.*"] border pixel 4, opacity 1
default_border pixel 2
default_floating_border pixel 10
hide_edge_borders smart
# Color definition
set $c1 #fd472f
set $c2 #d79921
set $c3 #99a2ea
set $c4 #333142
set $c5 #342f73
set $white #f4f4f8
set $dark #333333
set $dim #666666
#
set $focused_bgcolor $c4
set $focused_textcolor $dark
set $focused_indicator $c3
#
set $inactive_bgcolor $c5
set $inactive_textcolor $white
set $inactive_indicator $c5
#
set $unfocused_bgcolor $c2
set $unfocused_textcolor $dim
set $unfocused_indicator $c5
# Client colors
client.focused $focused_bgcolor $focused_bgcolor $focused_textcolor $focused_indicator $focused_bgcolor
client.focused_inactive $inactive_bgcolor $inactive_bgcolor $inactive_textcolor $inactive_indicator $inactive_bgcolor
client.unfocused $unfocused_bgcolor $unfocused_bgcolor $unfocused_textcolor $unfocused_indicator $unfocused_bgcolor
## Idle configuratio- manual behavior
bindsym $mod+Shift+x exec swaylock
bindsym --locked $mod+Mod1+a output * dpms on
bindsym --locked $mod+Mod1+z output * dpms off
# Sleep when closed behavior
# TODO: create script to make this multi-platform
bindswitch --reload lid:on exec erctl suspend
## 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
# Make window sticky
bindsym $mod+Shift+s sticky toggle
## Workspaces
# Workspace name
set $ws1 "💜"
set $ws2 "👯"
set $ws3 "🔱"
set $ws4 "🍀"
set $ws5 "🌟"
set $ws6 "🌈"
set $ws7 "🐞"
set $ws8 "♾️"
set $ws9 "👌"
set $ws10 "🌀"
set $wsb "🌎"
set $wsn "⚡"
set $wsm "🎺"
set $wso "🧛"
set $wsp "📜"
# 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
## Mouse bindings
# Reference for x11 mouse button codes:
# http://xahlee.info/linux/linux_x11_mouse_button_number.html
# Modifier is the forward button
set $mouse button9
# launcher with the left mouse button
bindsym --whole-window $mouse+button1 exec launcher
# switch to workspace 10 with right mouse button
bindsym --whole-window $mouse+button3 workspace $ws10
# open exit dialog with the backward button
bindsym --whole-window $mouse+button8 exec $sway_exit_prompt
## 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
# }
## Services directory
exec runsvdir-sway
## Application specific settings
# PDF
assign [app_id="okular"] $wsp
assign [app_id="zathura"] $wsp
# Media
for_window [app_id="pavucontrol"] focus, floating enable
for_window [title="Picture-in-Picture"] floating enable
for_window [app_id="mpv"] floating enable
# KDE
for_window [app_id="krunner"] floating enable
for_window [app_id="konsole"] floating enable
for_window [app_id=".* KDE Connect Daemon"] floating enable
for_window [title="Copying — Dolphin"] floating enable
for_window [app_id="polkit"] focus, floating enable, border pixel 4
# Firefox
for_window [title="Firefox - Sharing Indicator"] floating enable
for_window [app_id="org.mozilla.plasma-browser-integration-host"] floating enable