;===========================================================;
;                                                           ;
;  ██████╗  ██████╗ ██╗  ██╗   ██╗██████╗  █████╗ ██████╗   ;
;  ██╔══██╗██╔═══██╗██║  ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗  ;
;  ██████╔╝██║   ██║██║   ╚████╔╝ ██████╔╝███████║██████╔╝  ;
;  ██╔═══╝ ██║   ██║██║    ╚██╔╝  ██╔══██╗██╔══██║██╔══██╗  ;
;  ██║     ╚██████╔╝███████╗██║   ██████╔╝██║  ██║██║  ██║  ;
;  ╚═╝      ╚═════╝ ╚══════╝╚═╝   ╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═╝  ;
;                                                           ;
;===========================================================;

; Required packages:
; - xorg-xrandr (for launch script)
; - xrdb (for wal colors)

include-file = $HOME/.config/polybar/colors

[bar/main]
enable-ipc = true
monitor = ${env:MONITOR}
width = 100%
height = 3%
radius = 0
fixed-center = false


background = ${colors.background}
foreground = ${colors.foreground}

line-size = 3
line-color = #f00

border-size = 0
border-color = #00000000

padding-left = 0
padding-right = 2

module-margin-left = 1
module-margin-right = 2

font-0 = fixed:pixelsize=10;1
font-1 = "Hack Nerd Font:style=Regular:pixelsize=10;2"

modules-left = i3
modules-center = 
modules-right = playerctl pulseaudio mute-mic wireguard-status notify date

tray-position = right
tray-padding = 2
;tray-background = #0063ff


cursor-click = pointer
cursor-scroll = ns-resize

[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = false

format-foreground = ${colors.text}

label-mode-padding = 2
label-mode-foreground = ${colors.i3-mode-fg}
label-mode-background = ${colors.i3-mode-bg}

; focused = Active workspace on focused monitor
label-focused = %index%
label-focused-background = ${colors.i3-focus-bg}
label-focused-underline = ${colors.i3-focus-ul}
label-focused-padding = 2

; unfocused = Inactive workspace on any monitor
label-unfocused = %index%
label-unfocused-padding = 2

; visible = Active workspace on unfocused monitor
label-visible = %index%
label-visible-background = ${colors.i3-visable-bg}
label-visible-underline = ${colors.i3-visable-ul}
label-visible-padding = ${self.label-focused-padding}

; urgent = Workspace with urgency hint set
label-urgent = %index%
label-urgent-background = ${colors.i3-urgent-bg}
label-urgent-padding = 2


[module/xbacklight]
type = internal/xbacklight

format = <label> <bar>
label = BL

bar-width = 10
bar-indicator = |
bar-indicator-foreground = #fff
bar-indicator-font = 2
bar-fill = ─
bar-fill-font = 2
bar-fill-foreground = #9f78e1
bar-empty = ─
bar-empty-font = 2
bar-empty-foreground = ${colors.foreground}

[module/backlight-acpi]
inherit = module/xbacklight
type = internal/backlight
card = intel_backlight

[module/cpu]
type = internal/cpu
interval = 2
format-underline = #f90000
format-foreground = ${colors.text}
label = %percentage:2%%

[module/memory]
type = internal/memory
interval = 2
format-underline = ${colors.cpu-ul}
format-foreground = ${colors.text}
label = %percentage_used%%

[module/wlan]
type = internal/network
interface = wlp3s0
interval = 3.0

format-connected-foreground = ${colors.text}
format-connected = <label-connected>
format-connected-underline = #9f78e1
label-connected = %essid%

[module/date]
type = internal/date
interval = 5

date =
date-alt = " %Y-%m-%d"

time = %H:%M
time-alt = %H:%M:%S

format-foreground = ${colors.text}
format-underline = ${colors.date-ul}

label = %date% %time%

[module/pulseaudio]
type = internal/pulseaudio

format-volume-underline = ${colors.vol-ul}
format-volume = <label-volume> <bar-volume>
label-volume = %percentage%%
label-volume-foreground = ${colors.text}

label-muted = muted
label-muted-foreground = ${colors.text}
format-muted-underline = ${colors.vol-ul}

bar-volume-width = 10
bar-volume-foreground-0 = #55aa55
bar-volume-foreground-1 = #55aa55
bar-volume-foreground-2 = #55aa55
bar-volume-foreground-3 = #55aa55
bar-volume-foreground-4 = #55aa55
bar-volume-foreground-5 = #f5a70a
bar-volume-foreground-6 = #ff5555
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = ─
bar-volume-fill-font = 2
bar-volume-empty = ─
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.foreground}


[module/battery]
type = internal/battery
battery = BAT1
adapter = ADP1
full-at = 98

format-charging-foreground = ${colors.text}
format-charging = <label-charging>
format-charging-underline = ${colors.bat-ul}

format-discharging-foreground = ${colors.text}
format-discharging = <label-discharging>
format-discharging-underline = ${self.format-charging-underline}

format-full-foreground = ${colors.text}
format-full-prefix-foreground = ${colors.foreground}
format-full-underline = ${self.format-charging-underline}

[module/playerctl]
type = custom/script

exec = $XDG_CONFIG_HOME/polybar/playerctl-meta.sh

tail = true

format-foreground = ${colors.text}
format-underline = ${colors.spotify-ul}

[module/wireguard-status]
type = custom/ipc

format-foreground = ${colors.text}
format-underline = ${colors.wg-ul}

click-left = $HOME/.config/polybar/wireguard-switch.sh

hook-0 = $HOME/.config/polybar/wireguard-info.sh
initial = 1

[module/mute-mic]
type = custom/ipc

hook-0 = $XDG_CONFIG_HOME/polybar/is-muted.sh
inital = 1

[module/notify]
type = custom/script
exec = "echo "
click-left = kill -s USR1 $(pidof deadd-notification-center)
interval = 0

[settings]
screenchange-reload = true
;compositing-background = xor
;compositing-background = screen
;compositing-foreground = source
;compositing-border = over
pseudo-transparency = false

[global/wm]
margin-top = 5
margin-bottom = 5

; vim:ft=dosini
