[module/fan-speed]
    type = custom/script
    exec = $HOME/.config/polybar/scripts/fan-speed.sh
    interval = 1

    format-prefix = " "
    format-prefix-foreground = ${colors.foreground}
    format-underline = ${colors.pink}
    format = <label>

    label = %output:4%

[module/check-arch-updates]
    type = custom/script
    exec = cat $HOME/.cache/archlinux-updates.txt | wc -l 2>/dev/null | sed 's/^0$//'
    interval = 30

    format-prefix = " "
    format-prefix-foreground = ${colors.foreground}
    format-underline = ${colors.cyan}
    format = <label>

    click-left = alacritty -e sh -c "archlinux-update; checkupdates > $HOME/.cache/archlinux-updates.txt; read" &

    label = %output%

[module/bsp-layout]
    type = custom/script
    exec = bsp-layout get $(bspc query -D --names -d focused) | sed -E 's/^(-|tiled)$//m'
    interval = 0.1

    format-prefix = " "
    format-prefix-foreground = ${colors.foreground}
    format-underline = ${colors.red}
    format = <label>

    click-left = bsp-layout cycle --layouts tall,wide,grid,rgrid,monocle

    label = %output%

[module/bsp-layout-primary]
    inherit = module/bsp-layout
    exec = bsp-layout get $(bspc query -D --names -d ${MONITOR_PRIMARY}:focused) | sed -E 's/^(-|tiled)$//m'

[module/bsp-layout-secondary]
    inherit = module/bsp-layout
    exec = bsp-layout get $(bspc query -D --names -d ${MONITOR_SECONDARY}:focused) | sed -E 's/^(-|tiled)$//m'

[module/openweather]
    type = custom/script
    exec = $HOME/.config/polybar/scripts/openweather.sh
    interval = 600

    format-prefix-foreground = ${colors.foreground}
    format-underline = ${colors.green}

[module/player-mpris-simple]
    type = custom/script
    exec = $HOME/.config/polybar/scripts/player-mpris-simple.sh
    interval = 3
    click-left = playerctl -p spotifyd previous &
    click-right = playerctl -p spotifyd next &
    click-middle = playerctl -p spotifyd play-pause &

    format-prefix-foreground = ${colors.foreground}
    format-underline = ${colors.green}