// MIT License
// Copyright (c) 2024 LightCrimson
// https://github.com/yurihikari/garuda-hyprdots
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

{
  "layer": "top", // Waybar at top layer
  "position": "top", // Waybar position (top|bottom|left|right)
  "height": 30,
  "margin": "0 0 0 0",
  //"width": 1350, // Waybar width
  // Choose the order of the modules idle_inhibitor
  "modules-left": [
    "custom/media",
    "hyprland/workspaces",
    "tray"
  ],
  "modules-center": ["clock"],
  "modules-right": [
    "wireplumber",
    "backlight",
    "battery",
    "network",
    "custom/swaync"
  ],

  // Modules configuration

  "hyprland/workspaces": {
    "disable-scroll": true,
    "all-outputs": true,
    "format": "{icon}",
    // "format": "< %g >",
    // "format_focused" : "< %g ● >",
    "format-icons": {
      "1": "1",
      "2": "2",
      "3": "3",
      "4": "4",
      "5": "5",
      "6": "6",
      "7": "7",
      "8": "8",
      "9": "9",
      "10": "10"
    }
  },
  "custom/media": {
//      "format": "{format}",
      "max-length": 40,
      "escape": true,
      "exec": "playerctl metadata title -F"
  },
  "sway/mode": {
    "format": "<span style=\"italic\">{}</span>"
  },
  "sway/window": {
    "format": "~ {app_id}"
  },
  "idle_inhibitor": {
    "format": "{icon}",
    "format-icons": {
      "activated": "",
      "deactivated": ""
    }
  },
  "tray": {
    "icon-size": 14,
    "spacing": 5
  },
  "clock": {
    "tooltip-format": "<tt><small>{calendar}</small></tt>",
    "calendar": {
      "mode": "month",
      "mode-mon-col": 3,
      "weeks-pos": "right",
      "on-scroll": 1,
      "on-click-right": "mode",
      "format": {
        "months": "<span color='#ffead3'><b>{}</b></span>",
        "days": "<span color='#ecc6d9'><b>{}</b></span>",
        "weeks": "<span color='#99ffdd'><b>W{}</b></span>",
        "weekdays": "<span color='#ffcc66'><b>{}</b></span>",
        "today": "<span color='#ff6699'><b><u>{}</u></b></span>"
      }
    },
    "actions": {
      "on-click-right": "mode",
      "on-click-forward": "tz_up",
      "on-click-backward": "tz_down",
      "on-scroll-up": "shift_up",
      "on-scroll-down": "shift_down"
    },
    "format": "  {:%a %d %b  %I:%M %p}", //12 hour format
    // "format": " {:%d %m %Y  %H:%M}",	//24 hour format
    "format-alt": "  {:%d/%m/%Y  %H:%M:%S}",
    // //"timezones": [ "Kolkata" ],
    // //"max-length": 200
    "interval": 1
  },
  // "clock": {
  //     "format": "  {:%H:%M:%S}",
  //     "format-alt": "  {:%A, %B %d, %Y (%R)}",
  //     "tooltip-format": "<tt><small>{calendar}</small></tt>",
  //     "calendar": {
  //         "mode"          : "month",
  //         "mode-mon-col"  : 3,
  //         "weeks-pos"     : "right",
  //         "on-scroll"     : 1,
  //         "on-click-right": "mode",
  //         "format": {
  //             "months":     "<span color='#ffead3'><b>{}</b></span>",
  //             "days":       "<span color='#ecc6d9'><b>{}</b></span>",
  //             "weeks":      "<span color='#99ffdd'><b>W{}</b></span>",
  //             "weekdays":   "<span color='#ffcc66'><b>{}</b></span>",
  //             "today":      "<span color='#ff6699'><b><u>{}</u></b></span>"
  //         }
  //     },
  //     "actions": {
  //         "on-click-right": "mode",
  //         "on-click-forward": "tz_up",
  //         "on-click-backward": "tz_down",
  //         "on-scroll-up": "shift_up",
  //         "on-scroll-down": "shift_down"
  //     },
  //     "interval": 1
  // },
  "cpu": {
    "format": "﬙ {usage: >3}%",
    "on-click": "alacritty -e htop"
  },
  "battery": {
    "states": {
      // "good": 95,
      "warning": 30,
      "critical": 15
    },
    "format": "{icon} {capacity: >3}%",
    // "format-good": "", // An empty format will hide the module
    // "format-full": "",
    "format-icons": ["", "", "", "", ""]
    //"format-icons": ["", "", "", "", "", "", "", "", "", ""]
  },
  "backlight": {
      // "device": "acpi_video1",
      "format": "{percent}% {icon}",
      "format-icons": ["", "", "", "", "", "", "", "", ""]
  },
  "network": {
    // "interface": "wlp2s0", // (Optional) To force the use of this interface
    "format": "⚠  Disabled",
    //"format-wifi": "  {essid}",
    "format-wifi": "  Connected",
    // "format-ethernet": " {ifname}: {ipaddr}/{cidr}",
    "format-ethernet": "  Wired",
    "format-disconnected": "⚠  Disconnected",
    // "on-click": "alacritty -e nmtui"
    "on-click": "kitty -e nm-tui"
  },
  "wireplumber": {
    "format": "{volume}% {icon}",
    "format-muted": "",
    "on-click": "helvum",
    "format-icons": ["", "", ""]
  },
  "custom/swaync": {
    "format": " ",
    "on-click": "swaync-client -t",
    "tooltip": false
  }
}
