ui {
  border = 2
  gap = 5
  step = 50
  font = "Sarasa Mono J 12"

  colorscheme {
    background = 0x2E3440
    foreground = 0x2E3440
    selected   = 0xEBCB8B
    grouped    = 0xD08770
    first      = 0xA3BE8C
    conflict   = 0xBF616A
    insert     = 0xB48EAD
    active     = 0xECEFF4
    inactive   = 0x81A1C1
  }
}

outputs {
  "DP-2" {
    position = {
      x = -1920
      y = 0
    }
    background = {
      path = "/home/follie/Pictures/Wallpapers/9697jd.png"
      fit = stretch
    }
  }

  "eDP-1" {
    position = {
      x = 0
      y = 0
    }
    background = {
      path = "/home/follie/Pictures/Wallpapers/Elan3.png"
      fit = stretch
    }
  }

  "HDMI-A-1" {
    position = {
      x = 1920
      y = 0
    }
    background = {
      path = "/home/follie/Pictures/Wallpapers/i159.png"
      fit = stretch
    }
  }
}

inputs {
  keyboards {
    "*" = {
      xkb = {
        layout = "us,jp"
        options = "grp:rshift_toggle"
      }
      repeat-rate = 25
      repeat-delay = 600
    }
  }

  pointers {
    "*" = {
      tap = true
      tap-drag = true
      tap-drag-lock = true
      disable-while-typing = true
    }
  }

  switches {
    "Control Method Lid Switch" = lock
  }
}

layouts {
  # main stack
  s = {
    scale = 0.55
    left = single
    right = stack
  }

  # main queue
  q = {
    scale = 0.55
    top = single
    bottom = queue
  }

  # nautilus
  n = {
    left = single
    right = {
      top = single
      bottom = {
        right = single
        left = {
          bottom = single
          top = full
        }
      }
    }
  }

  f = full
  h = stack
  v = queue
  g = grid
}

actions {
  # generals
  terminal = alacritty
  foot = foot
  wofi = wofi --show=drun
  run = wofi --show=run
  searchmenu = searchmenu --wofi
  bukumenu = bukumenu --wofi
  manga = mangamenu --wofi
  clipboard = clipboard --wofi
  clearclip = clipboard --clear
  clearclipwofi = clipman clear --tool wofi
  emacs = emacsclient -c -a emacs

  # media
  volumeup = volumecontrol increase && pkill -x -RTMIN+11 waybar
  volumedown = volumecontrol decrease && pkill -x -RTMIN+11 waybar
  mute = volumecontrol toggle && pkill -x -RTMIN+11 waybar
  playpause = playerctl play-pause
  nextsong = playerctl next
  prevsong = playerctl previous

  # backlight
  lightup = brightness up
  lightdown = brightness down

  # screenshot
  screenfull = screenshot --full
  screenregion = screenshot --region
  screencopy = screenshot --region-copy
  screencopyfull = screenshot --full-copy
}

bindings {
  keyboard {
    "L+0"          = workspace-switch-to-sheet-0
    "L+1"          = workspace-switch-to-sheet-1
    "L+2"          = workspace-switch-to-sheet-2
    "L+3"          = workspace-switch-to-sheet-3
    "L+4"          = workspace-switch-to-sheet-4
    "L+5"          = workspace-switch-to-sheet-5
    "L+6"          = workspace-switch-to-sheet-6
    "L+7"          = workspace-switch-to-sheet-7
    "L+8"          = workspace-switch-to-sheet-8
    "L+9"          = workspace-switch-to-sheet-9
    "L+numbersign" = workspace-switch-to-sheet-alternate
    "L+Period"     = workspace-switch-to-sheet-current
    "L+j"          = workspace-switch-to-sheet-next
    "L+k"          = workspace-switch-to-sheet-prev
    "L+Comma"      = workspace-switch-to-sheet-next-inhabited
    "LS+Comma"     = workspace-switch-to-sheet-prev-inhabited
    "LSC+g"        = workspace-show-group
    "LSC+i"        = workspace-show-invisible
    "LSC+Period"   = workspace-show-all
    "LC+n"         = workspace-cycle-next
    "LC+p"         = workspace-cycle-prev

    "LC+i"      = sheet-show-invisible
    "LC+Period" = sheet-show-all
    "LC+g"      = sheet-show-group

    "LA+r"       = layout-reset
    "LA+Return"  = layout-restack-append
    "LAS+Return" = layout-restack-prepend
    "L+Home"     = layout-cycle-view-first
    "L+End"      = layout-cycle-view-last
    "L+n"        = layout-cycle-view-next
    "L+p"        = layout-cycle-view-prev
    "L+x"        = layout-exchange-view-next
    "LS+x"       = layout-exchange-view-prev
    "LA+x"       = layout-exchange-view-main

    "LS+0"          = view-pin-to-sheet-0
    "LS+1"          = view-pin-to-sheet-1
    "LS+2"          = view-pin-to-sheet-2
    "LS+3"          = view-pin-to-sheet-3
    "LS+4"          = view-pin-to-sheet-4
    "LS+5"          = view-pin-to-sheet-5
    "LS+6"          = view-pin-to-sheet-6
    "LS+7"          = view-pin-to-sheet-7
    "LS+8"          = view-pin-to-sheet-8
    "LS+9"          = view-pin-to-sheet-9
    "LS+numbersign" = view-pin-to-sheet-alternate
    "LS+Period"     = view-pin-to-sheet-current
    "LS+j"          = view-pin-to-sheet-next
    "LS+k"          = view-pin-to-sheet-prev

    "L+u"  = view-raise
    "L+d"  = view-lower
    "L+o"  = view-only
    "L+h"  = view-hide
    "L+q"  = view-quit
    "LS+n" = view-cycle-next
    "LS+p" = view-cycle-prev

    "L+Up"      = view-move-up
    "L+Down"    = view-move-down
    "L+Left"    = view-move-left
    "L+Right"   = view-move-right
    "LA+Up"     = view-decrease-size-up
    "LAS+Up"    = view-increase-size-up
    "LA+Down"   = view-increase-size-down
    "LAS+Down"  = view-decrease-size-down
    "LA+Left"   = view-decrease-size-left
    "LAS+Left"  = view-increase-size-left
    "LA+Right"  = view-increase-size-right
    "LAS+Right" = view-decrease-size-right
    "LS+Up"     = view-snap-up
    "LS+Down"   = view-snap-down
    "LS+Left"   = view-snap-left
    "LS+Right"  = view-snap-right
    "L+r"       = view-reset-geometry

    "L+minus" = view-toggle-maximize-vertical
    "L+less"  = view-toggle-maximize-horizontal
    "L+f"     = view-toggle-maximize-full
    "L5+plus" = view-toggle-floating
    "L+i"     = view-toggle-invisible
    "L5+p"    = view-toggle-public

    "LS+o"           = group-only
    "LS+h"           = group-hide
    "LS+u"           = group-raise
    "LS+d"           = group-lower
    "L+Tab"          = group-cycle-prev
    "LS+Tab"         = group-cycle-next
    "L+asciicircum"  = group-cycle-view-prev
    "LS+asciicircum" = group-cycle-view-next
    "LS+Home"        = group-cycle-view-first
    "LS+End"         = group-cycle-view-last

    "L+l"      = mode-enter-layout
    "L+s"      = mode-enter-sheet-assign
    "L+g"      = mode-enter-group-assign
    "L+m"      = mode-enter-mark-assign
    "L+acute"  = mode-enter-mark-select
    "LS+acute" = mode-enter-mark-switch-select
    "LCA+g"    = mode-enter-input-grab

    "LS+Backspace" = lock
    "LCA+q"        = quit
    "LCA+r"        = reload

    "L+Return" = action-terminal
    "LS+Return" = action-foot
    "L+w" = action-wofi
    "LC+w" = action-run
    "LA+e" = action-emacs
    "LA+w" = action-clipboard
    "LA+s" = action-searchmenu
    "LC+s" = action-bukumenu
    "LA+m" = action-manga
    "LA+c" = action-clearclip
    "LC+c" = action-clearclipwofi

    "0+XF86AudioRaiseVolume" = action-volumeup
    "0+XF86AudioLowerVolume" = action-volumedown
    "0+XF86AudioMute" = action-mute
    "0+XF86AudioPlay" = action-playpause
    "0+XF86AudioNext" = action-nextsong
    "0+XF86AudioPrev" = action-prevsong

    "0+XF86MonBrightnessDown" = action-lightdown
    "0+XF86MonBrightnessUp" = action-lightup

    "0+Print" = action-screenregion
    "L+Print" = action-screenfull
    "C+Print" = action-screencopy
    "A+Print" = action-screencopyfull

    "A+F1" = vt-switch-to-1
    "A+F2" = vt-switch-to-2
    "A+F3" = vt-switch-to-3
    "A+F4" = vt-switch-to-4
    "A+F5" = vt-switch-to-5
    "A+F6" = vt-switch-to-6
    "A+F7" = vt-switch-to-7
    "A+F8" = vt-switch-to-8
    "A+F9" = vt-switch-to-9

    "CA+s" = layout-apply-s
    "CA+q" = layout-apply-q
    "CA+n" = layout-apply-n
    "CA+f" = layout-apply-f
    "CA+h" = layout-apply-h
    "CA+v" = layout-apply-v
    "CA+g" = layout-apply-g
  }

  mouse {
    "L+left"  = mode-enter-move
    "L+right" = mode-enter-resize
  }
}
