### Key bindings
#
# Basics:
#
## Launch // Terminal ##
$bindsym $mod+Return exec $term

## Action // Kill focused window ##
$bindsym $mod+Shift+c kill

## Launch // Open launcher ##
$bindsym $alt_mod+space exec $menu
$bindsym $mod+F2 exec $menu

## Launch // Open clipboard ##
$bindsym $mod+Shift+p exec $clipboard

# 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

## Action // Reload Sway Configuration ##
$bindsym $mod+Shift+r reload
$bindsym $mod+F12 restart

## Action // Toggle Waybar ##
$bindsym $mod+Shift+b exec pkill -U $USER -x -SIGUSR1 waybar

# --locked flags allow the buttons to be used whilst the screen is locked.
$bindsym --locked XF86AudioRaiseVolume exec $volume_up

$bindsym --locked XF86AudioLowerVolume exec $volume_down

$bindsym --locked XF86AudioMute exec $volume_mute

$bindsym XF86AudioMicMute exec $mic_mute

$bindsym --locked XF86MonBrightnessUp exec $brightness_up

$bindsym --locked XF86MonBrightnessDown exec $brightness_down

$bindsym --locked XF86AudioPlay exec playerctl play-pause

$bindsym XF86AudioNext exec playerctl next

$bindsym XF86AudioPrev exec playerctl previous

$bindsym XF86PowerOff exec $shutdown

$bindsym XF86TouchpadToggle input type:touchpad events toggle enabled disabled

# Moving around:
#
# Move your focus around
## Navigation // Move focus // $mod + ↑ ↓ ← → ##
$bindsym $mod+$left focus left
$bindsym $mod+$down focus down
$bindsym $mod+$up focus up
$bindsym $mod+$right focus right

## Navigation // Move focused window // $mod + Shift + ↑ ↓ ← → ##
$bindsym $mod+Shift+$left move left
$bindsym $mod+Shift+$down move down
$bindsym $mod+Shift+$up move up
$bindsym $mod+Shift+$right move right

## Navigation // Move focused workspace // $mod + Alt + ↑ ↓ ← → ##
$bindsym $mod+$alt_mod+$right move workspace to output right
$bindsym $mod+$alt_mod+$left move workspace to output left
$bindsym $mod+$alt_mod+$down move workspace to output down
$bindsym $mod+$alt_mod+$up move workspace to output up

## Navigation // List all open windows in last-recently-used order ##
$bindsym $mod+p exec env RUST_BACKTRACE=1 swayr switch-window &>> /tmp/swayr.log

## Navigation // Switch to the last recently used window ##
$bindsym $alt_mod+Tab exec env RUST_BACKTRACE=1 swayr switch-to-urgent-or-lru-window &>> /tmp/swayr.log

## Navigation // Switch to the last recently used workspace ##
$bindsym $mod+Tab workspace back_and_forth

#
# Workspaces:
#
## Navigation // Switch workspace // $mod + [number] ##
$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

set $focus_ws [ "$focus_after_move" == 'true' ] && swaymsg workspace

## Action // Move focused window to workspace // $mod + Shift + [number] ##
$bindsym $mod+Shift+1 move container to workspace $ws1, exec $focus_ws $ws1
$bindsym $mod+Shift+2 move container to workspace $ws2, exec $focus_ws $ws2
$bindsym $mod+Shift+3 move container to workspace $ws3, exec $focus_ws $ws3
$bindsym $mod+Shift+4 move container to workspace $ws4, exec $focus_ws $ws4
$bindsym $mod+Shift+5 move container to workspace $ws5, exec $focus_ws $ws5
$bindsym $mod+Shift+6 move container to workspace $ws6, exec $focus_ws $ws6
$bindsym $mod+Shift+7 move container to workspace $ws7, exec $focus_ws $ws7
$bindsym $mod+Shift+8 move container to workspace $ws8, exec $focus_ws $ws8
$bindsym $mod+Shift+9 move container to workspace $ws9, exec $focus_ws $ws9
$bindsym $mod+Shift+0 move container to workspace $ws10, exec $focus_ws $ws10

#
# Layout stuff:
#
# change container layout (stacked, tabbed, toggle split)
$bindsym $mod+Shift+q layout stacking
$bindsym $mod+Shift+t layout tabbed
$bindsym $mod+Shift+w layout toggle split

# enter fullscreen mode for the focused container
$bindsym $mod+f fullscreen toggle
## Action // Toggle global fullscreen ##
$bindsym $mod+Shift+f fullscreen global

## Action // Scale up  ##
$bindsym $alt_mod+plus exec $scale_up

## Action // Scale down  ##
$bindsym $alt_mod+minus exec $scale_down

## Action // Scale default  ##
$bindsym $alt_mod+equal exec $scale_default

## Action // Toggle floating ##
$bindsym $mod+Shift+space floating toggle
$bindsym $mod+Shift+equal sticky toggle

## Navigation // Toggle focus between tiling and floating ##
# $bindsym $mod+space focus mode_toggle

## Navigation // Swap focus to the parent window ##
$bindsym $mod+a focus parent

## Launch // Toggle Help ##
$bindsym $mod+question exec $help

## Launch // Inhibit Idle ##
$bindsym $mod+Shift+i exec inhibit-idle interactive

default_border pixel 1
hide_edge_borders smart

# allow to kill focused floating shell windows using Esc
$bindsym --release Escape [app_id="floating_shell" con_id=__focused__] kill

## Launch // Task Manager ##
$bindsym Ctrl+$alt_mod+Delete exec $task_manager

## Launch // Emoji Picker ##
$bindsym $alt_mod+Shift+e exec $emoji_picker
