; ---------------------------------------------
;  Alter Linux i3wm edition
;  polybar modules
;
;  Watasuke
;  Twitter: @Watasuke102
;  Email  : Watasuke102@gmail.com
;
;  (c) 2021 Fascode Network.
; ---------------------------------------------


; base module (background color etc.)
[module/base]
padding    = 1


; launcher
[module/launcher]
inherit            = module/base
type               = custom/text
content            = "%{T1}  %{T-}"
content-foreground = ${color.icon_launcher}
content-background = ${color.bg-mod}
click-left         = exec rofi -show drun


; i3 status
[module/i3]
inherit           = module/base
type              = internal/i3
format            = <label-state>  <label-mode>
format-foreground = ${color.mod}
format-background = ${color.bg-mod}


; clock
[module/clock]
inherit = module/base
type              = internal/date
padding           = 3
time              = "  %I:%M %p  "
time-alt          = " %Y-%m-%d "

format            = <label>
format-foreground = ${color.mod}
format-background = ${color.bg-mod}
label             = %time%


; network status
[module/network]
type                           = internal/network
interface                      = wlan0
accumulate-stats               = true
unknown-as-up                  = true
interval                       = 1

format-connected               = <label-connected>
format-disconnected            = <label-disconnected>

label-connected                = "%{T1}  %{T-} %essid%"
label-disconnected             = "%{T1}  %{T-} (none)"

format-connected-foreground    = ${color.icon_network}
format-connected-background    = ${color.bg-mod}
format-disconnected-foreground = ${color.icon_network}
format-disconnected-background = ${color.bg-mod}


; CPU used
[module/cpu]
type              = internal/cpu
interval          = 2
format            = <label>%
label             = "%{T1}  %{T-}%percentage:3%"
format-foreground = ${color.icon_cpu}
format-background = ${color.bg-mod}


; memory used
[module/memory]
type              = internal/memory
interval          = 2
format            = <label>
label             = "%{T1}  %{T-}%gb_used% "
format-foreground = ${color.icon_memory}
format-background = ${color.bg-mod}


; battery
[module/battery]
type                          = internal/battery
interval                      = 2
battery                       = BAT0
adapter                       = ADP1

format-charging               =  <ramp-capacity>
format-charging-foreground    = ${color.icon_battery}
format-charging-background    = ${color.bg-mod}

format-discharging            =  <ramp-capacity>
format-discharging-foreground = ${color.icon_battery}
format-discharging-background = ${color.bg-mod}

ramp-capacity-0               = "%{T1}   %{T-}"
ramp-capacity-1               = "%{T1}   %{T-}"
ramp-capacity-2               = "%{T1}   %{T-}"
ramp-capacity-3               = "%{T1}   %{T-}"
ramp-capacity-4               = "%{T1}   %{T-}"


; power menu
[module/power]
inherit            = module/base
type               = custom/text
content            = "%{T1}  %{T-}"
content-foreground = ${color.icon_power}
content-background = ${color.bg-mod}
click-left         = exec rofi -show power

