; vim: ft=dosini

[colors]
transparent = #00000000

red = #BF616A
orange = #D08770
yellow = #EBCB8B
green = #A3BE8C
purple = #B48EAD

blue0 = #8FBCBB
blue1 = #88C0D0
blue2 = #81A1C1
blue3 = #5E81AC

nord0 = #2E3440
nord1 = #3b4252
nord2 = #434c5e
nord3 = #4C566A

frost0 = #d8dee9
frost1 = #e5e9f0
frost2 = #ECEFF4

accent = ${colors.blue3}
foreground = ${colors.frost2}

shade0 = ${colors.nord3}
shade1 = ${colors.nord2}
shade2 = ${colors.nord1}
shade3 = ${colors.nord0}
tray = ${colors.nord0}

###############################################################################
[settings]
format-foreground = ${colors.foreground}
format-background = ${colors.nord0}
screenchange-reload = true

###############################################################################
[bar/main]
monitor = ${env:MONITOR}
enable-ipc = false

# FONTS PROVIDED WITH DOTFILES
# https://github.com/stark/siji

font-0 = "InconsolataLGC Nerd Font Mono:pixelsize=9;2"
font-1 = "IPAGothic:fontformat=truetype:antialias=false:pixelsize=11;2"
font-2 = "Siji:size=7;2"

bottom = false
fixed-center = true

padding-left = 0
padding-right = 0

radius = 0.0

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

tray-position = right
tray-padding = 2
tray-background = ${colors.tray}
tray-offset-x = 8
tray-offset-y = 0

# 100%-16px(gaps)-8px(tray)
width = 100%:-24px
#width = 100%:-16px
height = 27

offset-y = 8px
offset-x = 8px

override-redirect = true

modules-left = i3
modules-center =
modules-right = spotify backlight volume battery date
separator =

wm-name = i3
wm-restack = i3

###############################################################################
[module/i3]
type = internal/i3

pin-workspaces = true
index-sort = true
enable-click = true
enable-scroll = true
wrapping-scroll = false

format = <label-state> <label-mode>

background = ${colors.nord0}

ws-icon-0 = 1;1
ws-icon-1 = 2;2
ws-icon-2 = 3;3
ws-icon-3 = 4;4
ws-icon-4 = 5;5
ws-icon-5 = 6;6
ws-icon-6 = 7;7
ws-icon-7 = 8;8
ws-icon-8 = 9;9
ws-icon-9 = 10;10

label-focused = %icon%
label-focused-foreground = ${colors.foreground}
label-focused-background = ${colors.accent}
label-focused-padding = 2

label-unfocused = %index%
label-unfocused-foreground = ${colors.foreground}
label-unfocused-background = ${self.background}
label-unfocused-padding = 2

label-visible = %index%
label-visible-foreground = ${colors.foreground}
label-visible-background = ${self.background}
label-visible-padding = 2

label-urgent = %index%
label-urgent-foreground = ${colors.foreground}
label-urgent-background = ${colors.red}
label-urgent-padding = 2

###############################################################################
[module/date]
type = internal/date

format-padding = 2
format-background = ${colors.shade3}

interval = 1.0

time =  %I:%M %p
time-alt =  %Y-%m-%d%

format = <label>

label = %time%

###############################################################################
[module/title]
type = internal/xwindow
label = %title%
format = <label>
label-maxlen = 80
label-empty = "Yoroshiku!"
format-padding = 2

###############################################################################
[module/cpu]
type = internal/cpu

interval = 5

format-background = ${colors.frost1}
format-foreground = ${colors.nord0}

format = <label>
format-prefix = 
format-padding = 2

label = " %percentage%%"

###############################################################################
[module/memory]
type = internal/memory

interval = 3

format = <label>
format-prefix = 

label = " %mb_used%"

###############################################################################
[module/battery]
type = internal/battery
full-at = 99
battery = BAT0
apdapter = ADP1

bg = ${colors.shade2}

format-charging = <animation-charging> <label-charging>
format-charging-background = ${self.bg}
format-charging-padding = 2

format-discharging = <ramp-capacity> <label-discharging>
format-discharging-background = ${self.bg}
format-discharging-padding = 2

format-full = <ramp-capacity> <label-full>
format-full-background = ${self.bg}
format-full-padding = 2

label-charging = %percentage%%
label-discharging = %percentage%%
label-full = 100%

; Only applies if <ramp-capacity> is used
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-3 = 
ramp-capacity-4 = 
ramp-capacity-5 = 
ramp-capacity-6 = 
ramp-capacity-7 = 
ramp-capacity-8 = 
ramp-capacity-9 = 

; Only applies if <animation-charging> is used
animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-3 = 

; Framerate in milliseconds
animation-charging-framerate = 750

###############################################################################
[module/volume]
type = internal/pulseaudio

format-volume-background = ${colors.shade1}
format-volume-padding = 2

format-volume = <ramp-volume> <label-volume>

label-volume = %percentage%%

format-muted-prefix = " "
format-muted-padding = 2
label-muted = "Muted"

ramp-volume-0 = 
ramp-volume-1 = 
ramp-volume-2 = 
ramp-volume-3 = 
ramp-volume-4 = 

ramp-headphones-0 = 
ramp-headphones-1 = 

###############################################################################
[module/network]
type = internal/network
interface = wlo1

interval = 1.0
accumulate-stats = true
unknown-as-up = true

format-connected = <ramp-signal> <label-connected>
format-connected-background = ${colors.nord1}
format-connected-padding = 2

format-disconnected = <label-disconnected>
format-disconnected-background = ${colors.nord1}
format-disconnected-padding = 2

label-connected = %essid%
label-disconnected =  Disconnected

; Only applies if <ramp-signal> is used
ramp-signal-0 = 
ramp-signal-1 = 
ramp-signal-2 = 
ramp-signal-3 = 
ramp-signal-4 = 

###############################################################################
[module/backlight]
type = internal/backlight

format-padding = 2
format-background = ${colors.shade0}
format-foreground = ${colors.foreground}

# ls -1 /sys/class/backlight
card = amdgpu_bl0

format = <bar>
format-prefix = " "
label = " %percentage%%"

bar-width = 10
bar-indicator = |
bar-fill = ─
bar-empty= ─

###############################################################################
[module/load]
type = custom/script
exec = ~/.config/polybar/scripts/load.sh
interval = 5.0

###############################################################################
[module/spotify]
type = custom/script

format-padding = 2
format-background = ${colors.blue3}
format-prefix = " "

exec = ~/.config/polybar/scripts/spotify.sh %artist% - %title%
tail = true
interval = 2

###############################################################################
[module/powerbutton]
type = custom/text

content-padding = 2
content-background = ${colors.nord1}
content-foreground = ${colors.frost2}

content = "襤"

click-left = ~/scripts/powermenu
