This repository has been archived on 2024-04-07. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/dotfiles/sway/keys-window

85 lines
2.4 KiB
Text

# {{@@ header() @@}}
# _____ ____ _ _ _
# / __\ \ /\ / / _` | | | |
# \__ \\ V V / (_| | |_| |
# |___/ \_/\_/ \__,_|\__, |
# |___/
bindsym --to-code {
###############################################################
# Moving around
###############################################################
{%@@ for dir in "Left,Up,Right,Down".split(',') @@%}
{%@@ set resize_cmd = "{} {} 20px".format(
('shrink' if (loop.index0 < 2) else 'grow'),
('height' if (loop.index0 % 2) else 'width'),
) @@%}
# Move focus
$mod+${{@@ dir @@}} focus {{@@ dir @@}}
$mod+{{@@ dir @@}} focus {{@@ dir @@}}
# Move window
$mod+Shift+${{@@ dir @@}} move {{@@ dir @@}}
$mod+Shift+{{@@ dir @@}} move {{@@ dir @@}}
# Resize window
$mod+Control+${{@@ dir @@}} resize {{@@ resize_cmd @@}}
$mod+Control+{{@@ dir @@}} resize {{@@ resize_cmd @@}}
{%@@ endfor @@%}
###############################################################
# Workspaces
###############################################################
# Switch to workspace
# Move focused container to workspace
{%@@ for i in range(1,11) @@%}
$mod+{{@@ i%10 @@}} workspace {{@@ i @@}}
$mod+Shift+{{@@ i%10 @@}} move container workspace {{@@ i @@}}
{%@@ endfor @@%}
# go/move to Workspaces
# button8,9 = Mouse next/prev button
# Prior,Next = PageUp/Down
{%@@ for targ, buttons in {
"prev_on_output": [ key.tabL, "bracketleft", "Prior", "button9", ],
"next_on_output": [ key.tabR, "bracketright", "Next", "button8", ],
}.items() @@%}
{%@@ for button in buttons @@%}
{%@@ set pref = ("--whole-window " if "button" in button) @@%}
{{@@ pref @@}}$mod+{{@@ button @@}} workspace {{@@ targ @@}}
{{@@ pref @@}}$mod+Shift+{{@@ button @@}} move workspace {{@@ targ @@}}
{%@@ endfor @@%}
{%@@ endfor @@%}
###############################################################
# Layout
###############################################################
# Splits
$mod+v splitv
# No splith since we can just mod+r
# Layout styles
$mod+t layout tabbed
$mod+r layout toggle split
# Make the current focus fullscreen
$mod+f fullscreen
# Floating
$mod+Shift+space floating toggle
$mod+space focus mode_toggle
# Move focus to the parent container
$mod+a focus parent
$mod+z focus child
$mod+tab scratchpad show
$mod+Shift+tab move container scratchpad
}
# vim: ft=i3