# Place a copy of this config to ~/.dwmac.toml
# After that, you can edit ~/.dwmac.toml to your liking

# Config version for compatibility and deprecations
# Fallback value (if you omit the key): config-version = 1
config-version = 2

# You can use it to add commands that run after Dwmac startup.
# Available commands : https://hillyu.github.io/Dwmac/commands
after-startup-command = []

# Start Dwmac at login
start-at-login = false

# Possible values: master-stack
default-root-container-layout = 'master-stack'

# mfact for master-stack
default-mfact = 0.5

# Possible values: left|right
# Default value: left
master-position = 'left'

# Whether new windows should be attached to the master position (index 0) or the last position.
# Fallback value (if you omit the key): attach-below = false
attach-below = false

# Possible values: horizontal|vertical|auto
# 'auto' means: wide monitor (anything wider than high) gets horizontal orientation,
#               tall monitor (anything higher than wide) gets vertical orientation
default-root-container-orientation = 'auto'

# Mouse follows focus when focused monitor changes
# Drop it from your config, if you don't like this behavior
# See https://hillyu.github.io/Dwmac/guide#on-focus-changed-callbacks
# See https://hillyu.github.io/Dwmac/commands#move-mouse
# Fallback value (if you omit the key): on-focused-monitor-changed = []
on-focused-monitor-changed = ['move-mouse monitor-lazy-center']

# You can effectively turn off macOS "Hide application" (cmd-h) feature by toggling this flag
# Useful if you don't use this macOS feature, but accidentally hit cmd-h or cmd-alt-h key
# Also see: https://hillyu.github.io/Dwmac/goodies#disable-hide-app
automatically-unhide-macos-hidden-apps = false

# Whether to automatically center floating windows.
# Fallback value (if you omit the key): center-floating-windows = false
center-floating-windows = false

# List of workspaces that should stay alive even when they contain no windows,
# even when they are invisible.
# This config version is only available since 'config-version = 2'
# Fallback value (if you omit the key): persistent-workspaces = []
persistent-workspaces = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B",
                         "C", "D", "E", "F", "G", "I", "M", "N", "O", "P", "Q",
                         "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]

# A callback that runs every time binding mode changes
# See: https://hillyu.github.io/Dwmac/guide#binding-modes
# See: https://hillyu.github.io/Dwmac/commands#mode
on-mode-changed = []

# Possible values: (qwerty|dvorak|colemak)
# See https://hillyu.github.io/Dwmac/guide#key-mapping
[key-mapping]
    preset = 'qwerty'

# Gaps between windows (inner-*) and between monitor edges (outer-*).
# Possible values:
# - Constant:     gaps.outer.top = 8
# - Per monitor:  gaps.outer.top = [{ monitor.main = 16 }, { monitor."some-pattern" = 32 }, 24]
#                 In this example, 24 is a default value when there is no match.
#                 Monitor pattern is the same as for 'workspace-to-monitor-force-assignment'.
#                 See:
#                 https://hillyu.github.io/Dwmac/guide#assign-workspaces-to-monitors
[gaps]
    inner.horizontal = 0
    inner.vertical =   0
    outer.left =       0
    outer.bottom =     0
    outer.top =        0
    outer.right =      0

# 'main' binding mode declaration
# See: https://hillyu.github.io/Dwmac/guide#binding-modes
# 'main' binding mode must be always presented
# Fallback value (if you omit the key): mode.main.binding = {}
[mode.main.binding]

    # All possible keys:
    # - Letters.        a, b, c, ..., z
    # - Numbers.        0, 1, 2, ..., 9
    # - Keypad numbers. keypad0, keypad1, keypad2, ..., keypad9
    # - F-keys.         f1, f2, ..., f20
    # - Special keys.   minus, equal, period, comma, slash, backslash, quote, semicolon,
    #                   backtick, leftSquareBracket, rightSquareBracket, space, enter, esc,
    #                   backspace, tab, pageUp, pageDown, home, end, forwardDelete,
    #                   sectionSign (ISO keyboards only, european keyboards only)
    # - Keypad special. keypadClear, keypadDecimalMark, keypadDivide, keypadEnter, keypadEqual,
    #                   keypadMinus, keypadMultiply, keypadPlus
    # - Arrows.         left, down, up, right

    # All possible modifiers: cmd, alt, ctrl, shift

    # All possible commands: https://hillyu.github.io/Dwmac/commands

    # See: https://hillyu.github.io/Dwmac/commands#exec-and-forget
    # You can uncomment the following lines to open up terminal with alt + enter shortcut
    # alt-enter = '''exec-and-forget osascript -e '
    # tell application "Terminal"
    #     do script
    #     activate
    # end tell'
    # '''

    # See: https://hillyu.github.io/Dwmac/commands#layout
    cmd-alt-ctrl-slash = 'layout master-stack'

    # See: https://hillyu.github.io/Dwmac/commands#focus
    cmd-alt-ctrl-j = 'focus next'
    cmd-alt-ctrl-k = 'focus prev'
    cmd-alt-ctrl-h = 'mfact -0.1'
    cmd-alt-ctrl-l = 'mfact +0.1'

    # See: https://hillyu.github.io/Dwmac/commands#move
    cmd-alt-ctrl-space = 'move-node-to-master'
    cmd-alt-ctrl-shift-j = 'swap next'
    cmd-alt-ctrl-shift-k = 'swap prev'

    # See: https://hillyu.github.io/Dwmac/commands#resize
    cmd-alt-ctrl-minus = 'resize smart -50'
    cmd-alt-ctrl-equal = 'resize smart +50'

    # See: https://hillyu.github.io/Dwmac/commands#workspace
    cmd-alt-ctrl-1 = 'workspace 1'
    cmd-alt-ctrl-2 = 'workspace 2'
    cmd-alt-ctrl-3 = 'workspace 3'
    cmd-alt-ctrl-4 = 'workspace 4'
    cmd-alt-ctrl-5 = 'workspace 5'
    cmd-alt-ctrl-6 = 'workspace 6'
    cmd-alt-ctrl-7 = 'workspace 7'
    cmd-alt-ctrl-8 = 'workspace 8'
    cmd-alt-ctrl-9 = 'workspace 9'

    # See: https://hillyu.github.io/Dwmac/commands#move-node-to-workspace
    cmd-alt-ctrl-shift-1 = 'move-node-to-workspace 1'
    cmd-alt-ctrl-shift-2 = 'move-node-to-workspace 2'
    cmd-alt-ctrl-shift-3 = 'move-node-to-workspace 3'
    cmd-alt-ctrl-shift-4 = 'move-node-to-workspace 4'
    cmd-alt-ctrl-shift-5 = 'move-node-to-workspace 5'
    cmd-alt-ctrl-shift-6 = 'move-node-to-workspace 6'
    cmd-alt-ctrl-shift-7 = 'move-node-to-workspace 7'
    cmd-alt-ctrl-shift-8 = 'move-node-to-workspace 8'
    cmd-alt-ctrl-shift-9 = 'move-node-to-workspace 9'

    # See: https://hillyu.github.io/Dwmac/commands#workspace-back-and-forth
    cmd-alt-ctrl-tab = 'workspace-back-and-forth'
    # See: https://hillyu.github.io/Dwmac/commands#move-workspace-to-monitor
    cmd-alt-ctrl-shift-tab = 'move-workspace-to-monitor --wrap-around next'

    # See: https://hillyu.github.io/Dwmac/commands#mode
    cmd-alt-ctrl-shift-semicolon = 'mode service'

# 'service' binding mode declaration.
# See: https://hillyu.github.io/Dwmac/guide#binding-modes
[mode.service.binding]
    esc = ['reload-config', 'mode main']
    f = ['layout floating tiling', 'mode main'] # Toggle between floating and tiling layout
    backspace = ['close-all-windows-but-current', 'mode main']

    # sticky is not yet supported https://github.com/hillyu/Dwmac/issues/2
    #s = ['layout sticky tiling', 'mode main']


