# Advanced i3status-rust configuration
# Based on the i3xrocks blocks from your i3 setup

[[block]]
block = "custom"
command = "~/.config/sway/scripts/osrs/osrs-mode-status.sh"
format = " $text "
interval = 1
click = [
    {button = "left", cmd = "~/.config/sway/scripts/osrs/osrs-mode-toggle.sh", update = true}
]

[[block]]
block = "custom"
command = "~/.config/sway/scripts/display-profile/display-profile-status.sh"
format = " $text "
interval = 1
click = [
    {button = "left", cmd = "~/.config/sway/scripts/display-profile/display-profile-toggle.sh", update = true}
]

[[block]]
block = "custom"
command = "echo ''"
format = " $text "
interval = 1
click = [
    {button = "left", cmd = "~/.config/sway/scripts/i3status/set-random-bg.sh", update = false},
]

#[[block]]
#block = "custom"
#command = "~/.config/sway/scripts/i3status/get-focused-window.sh"
#format = " $text "
#interval = 5

[[block]]
block = "net"
format = " $icon {$signal_strength $ssid $frequency|Wired} @ $device "
interval = 1

[[block]]
block = "cpu"
interval = 5
format = " $icon $utilization "
format_alt = " $icon $frequency{ $boost} "

[[block]]
block = "memory"
format = " $icon $mem_used_percents.eng(w:2) "
interval = 10
warning_mem = 80.0
critical_mem = 90.0

[[block]]
block = "battery"
device = "BAT0"
format = " $icon $percentage $time "
interval = 10
missing_format = ""

[[block]]
block = "sound"
format = " $icon $volume "
click = [
    {button = "left", cmd = "pavucontrol --tab=3"},
    {button = "right", cmd = "pactl set-sink-mute @DEFAULT_SINK@ toggle"},
]

[[block]]
block = "bluetooth"
mac = ""
format = " $icon $label "
disconnected_format = ""

# Custom Bluetooth connected devices block
[[block]]
block = "custom"
command = "~/.config/sway/scripts/i3status/bluetooth.sh"
format = " $text "
interval = 10
click = [
    {button = "left", update = true},
    {button = "right", update = true},
]

# Custom weather block using your wttr.in script
# [[block]]
# block = "custom"
# command = "~/.config/sway/scripts/i3status/wttrin-weather.sh"
# format = " 🌤 $text "
# interval = 1800
# click = [
#     {button = "left", update = true},
#     {button = "right", update = true},
# ]

# Alternative: Weather with custom location
# Uncomment and modify this block if you want weather for a different city
[[block]]
block = "custom"
command = "~/.config/sway/scripts/i3status/wttrin-weather.sh"
format = "$text"
interval = 1800

# Alternative: Weather with different format
# Format options: https://github.com/chubin/wttr.in
# 1 = current conditions, 2 = current + today, 3 = current + today + tomorrow, 4 = current + 3 days
# [[block]]
# block = "custom"
# command = "weather_format='2' ~/.config/sway/scripts/i3status/wttrin-weather.sh"
# format = " 📅 $text "
# interval = 1800

[[block]]
block = "time"
format = " $icon $timestamp.datetime(f:'%Y-%m-%d %H:%M:%S%z') "
interval = 1

[icons]
icons = "awesome6"
