###############################################################################
# i3 Bar
###############################################################################

# Toggle bar visibility
## Modify // Toggle Bar // <> i ##
set_from_resource $wm.binding.bar_toggle wm.binding.bar_toggle i
bindsym $mod+$wm.binding.bar_toggle bar mode toggle

set_from_resource $wm.bar.position wm.bar.position bottom
set_from_resource $wm.bar.font wm.bar.font monospace
set_from_resource $wm.bar.separatorchar wm.bar.separatorchar " "
set_from_resource $wm.bar.stripworkspacenumbers wm.bar.stripworkspacenumbers yes
set_from_resource $wm.bar.mode wm.bar.mode dock
set_from_resource $wm.bar.workspace_min_width wm.bar.workspace_min_width 36

# Mouse wheel over the bar. Each resource is the bar binding for one wheel direction.
# The defaults only run "nop" when the wheel click is released, which leaves the bar's
# own behaviour alone: scrolling over the workspace buttons switches workspaces.
# To stop that, bind the press instead, e.g. in ~/.config/regolith3/Xresources:
#   wm.bar.binding.wheel_up: button4 nop
#   wm.bar.binding.wheel_down: button5 nop
#   wm.bar.binding.wheel_left: button6 nop
#   wm.bar.binding.wheel_right: button7 nop
# Scrolling over a status block still goes to that block.
set_from_resource $wm.bar.binding.wheel_up wm.bar.binding.wheel_up --release button4 nop
set_from_resource $wm.bar.binding.wheel_down wm.bar.binding.wheel_down --release button5 nop
set_from_resource $wm.bar.binding.wheel_left wm.bar.binding.wheel_left --release button6 nop
set_from_resource $wm.bar.binding.wheel_right wm.bar.binding.wheel_right --release button7 nop
set_from_resource $wm.bar.status_config wm.bar.status_config /etc/regolith/i3status-rust/config.toml

# i3status config file. Override this for a custom status bar generator.
set_from_resource $wm.bar.status_command wm.bar.status_command i3status-rs $wm.bar.status_config

# The bar configuration
bar {
  position $wm.bar.position
  mode $wm.bar.mode
  font pango:$wm.bar.font
  separator_symbol $wm.bar.separatorchar
  status_command $wm.bar.status_command
  strip_workspace_numbers $wm.bar.stripworkspacenumbers
  workspace_min_width $wm.bar.workspace_min_width
  bindsym $wm.bar.binding.wheel_up
  bindsym $wm.bar.binding.wheel_down
  bindsym $wm.bar.binding.wheel_left
  bindsym $wm.bar.binding.wheel_right

  colors {
      background $wm.bar.background.color
      statusline $wm.bar.statusline.color
      separator  $wm.bar.separator.color

#                        BORDER  BACKGROUND TEXT
      focused_workspace  $wm.bar.workspace.focused.border.color      $wm.bar.workspace.focused.background.color   $wm.bar.workspace.focused.text.color
      active_workspace   $wm.bar.workspace.active.border.color       $wm.bar.workspace.active.background.color    $wm.bar.workspace.active.text.color
      inactive_workspace $wm.bar.workspace.inactive.border.color     $wm.bar.workspace.inactive.background.color  $wm.bar.workspace.inactive.text.color
      urgent_workspace   $wm.bar.workspace.urgent.border.color       $wm.bar.workspace.urgent.background.color    $wm.bar.workspace.urgent.text.color
  }
}
