[settings]
#compositing-foreground = over

[colors]
background = #181818
foreground = #ebdbb2
foreground2 = #77ebdbb2
line = #bbb
border = #bbb
accent = #434d5e
accent2 = #637291
selected = #81a2be
focused = #f0c674

black = #32344a
red = #f7768c
green = #9ece6a
yellow = #e0af68
blue = #aabbff
magenta = #ad8ee6
cyan = #449dab
white = #787c99

[global/wm]
# margin-top = 0
# margin-bottom = 0

[bar/top]
font-0 = "Fira Code:pixelsize=11:weight=medium;1"
font-1 = "Feather:pixelsize:12;1"
font-2 = "siji:pixelsize=12;1"
font-3 = "Font Awesome:size=12;1"

monitor = ${env:MONITOR}

line-size = 2

# fixed-center = true
# override-redirect = true

width = 100%
height = 32

bottom = 0

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

padding-left = 1
padding-right = 1
module-margin = 1

modules-left = date time filesystem 
modules-center = workspaces title
modules-right = cmus pulseaudio battery wlan uptime

[module/uptime]
type = "custom/script"
exec = awk '{print int($1/3600)"h "int(($1%3600)/60)"m "}' /proc/uptime
interval = 1
label = uptime: %output%
format-underline = ${colors.foreground2}

[module/cmus]
type = custom/script

exec = ~/.config/polybar/scripts/cmus.sh
exec-if = pgrep -x cmus
interval = 1

click-left = cmus-remote --next
click-right = cmus-remote --prev
click-middle = cmus-remote --pause
scroll-up = cmus-remote --volume +5%
scroll-down = cmus-remote --volume -5%

label-font = 1
format = <label>
format-underline = ${colors.foreground2}
label =  %output%
# label = Playing: %output%
label-maxlen = 80

[module/spotify]
type = custom/script
tail = true
; prefix symbol is shown before the text
format-prefix = " "
format = <label>
exec = ~/.config/polybar/scripts/scroll_spotify_status.sh

[module/spotify-prev]
type = custom/script
exec = echo "<previous-song-symbol>"
format = <label>
click-left = playerctl previous spotify

[module/spotify-play-pause]
type = custom/ipc
hook-0 = echo "<playing-symbol>"
hook-1 = echo "<pause-symbol>"
initial = 1
click-left = playerctl play-pause spotify

[module/spotify-next]
type = custom/script
exec = echo "next-song-symbol"
format = <label>
click-left = playerctl next spotify

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

format-connected = (<ramp-signal>) <label-connected>
format-connected-underline = ${colors.foreground}
label-connected = %essid%
format-disconnected =
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected

ramp-signal-0 = 1
ramp-signal-1 = 2
ramp-signal-2 = 3
ramp-signal-3 = 4
ramp-signal-4 = 5
ramp-signal-foreground = ${colors.foreground}

[module/eth]
type = internal/network
interface = enp0s31f6
interval = 3.0

format-connected-underline = ${colors.foreground}
format-connected-prefix = " "
format-connected-prefix-foreground = ${colors.foreground}
label-connected = %local_ip%

format-disconnected =
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected

[module/date]
type = internal/date
label =  %date%  
# label = %date%
date = %Y-%m-%d
time = %H:%M:%S
interval = 1

[module/time]
type = internal/date
label = %time%
time = %H%M.%S
interval = 1

[module/filesystem]
type = internal/fs
mount-0 = /
mount-1 = /mnt
interval= 1
fixed-values = true
spacing = 2
format-mounted =  <label-mounted> 
format-mounted-underline = ${colors.foreground2}
# format-mounted-foreground = ${colors.foreground}
format-unmounted = 
label-mounted = %mountpoint% %free%
label-mounted-foreground = ${colors.foreground2}

[module/kernel]
type = custom/script
exec = uname -r
interval = 600
format = " <label>"
label = %output%

[module/pulseaudio]
type = internal/pulseaudio

#format-volume = <label-volume> <bar-volume>
format-volume = <label-volume>
label-volume =  %percentage%%
# label-volume = %percentage%%
label-volume-foreground = ${root.foreground}

#format-muted = <label-muted> <bar-volume>
format-muted = <label-muted>
label-muted =  %percentage%%
# label-muted = %percentage%%
label-muted-foreground = ${colors.red}

bar-volume-width = 5
bar-volume-foreground-0 = ${colors.green}
bar-volume-foreground-1 = ${colors.green}
bar-volume-foreground-2 = ${colors.green}
bar-volume-foreground-3 = ${colors.green}
bar-volume-foreground-4 = ${colors.yellow}
bar-volume-foreground-5 = ${colors.yellow}
bar-volume-foreground-6 = ${colors.red}
bar-volume-gradient = false
bar-volume-indicator = 
bar-volume-indicator-font = 0
bar-volume-fill = ─
bar-volume-fill-font = 0
bar-volume-empty = ─
bar-volume-empty-font = 0
bar-volume-empty-foreground = #666


[module/title]
type = internal/xwindow
format-background = ${colors.background}
format-foreground = #f0c674
format-padding = 1
label-maxlen = 40

[module/battery]
type = internal/battery
full-at = 98
time-format = %H:%M

format-charging = <animation-charging> <label-charging>
label-charging = %percentage%% 

format-discharging = <ramp-capacity> <label-discharging>
label-discharging = %percentage%% 

format-full = <label-full>
format-full-prefix = " "
format-full-prefix-foreground = ${colors.foreground2}

ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-foreground = ${colors.foreground2} 

animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-foreground = ${colors.foreground2}
animation-charging-framerate = 750

[module/workspaces]
type = internal/xworkspaces

# %index% = Index of the workspace
# %name% = Name of the workspace
# %icon% = Icon of the workspace
# %nwin% = Number of windows in workspace

pin-workspaces = true
enable-click = true
enable-scroll = true

format = <label-state>
label-monitor = %index%
label-monitor-underline = ${colors.yellow}

label-active = %index%
# label-active = %nwin%
label-active-foreground = ${colors.yellow}
label-active-underline =  ${colors.yellow}
label-active-padding = 1

label-occupied = %index%
label-occupied-foreground = ${colors.foreground2}
label-occupied-padding = 1

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

label-empty = 
label-empty-foreground = ${colors.foreground2}
label-empty-padding = 0

icon-0 = 1;
icon-1 = 2;
icon-2 = 3;
icon-3 = 4;
icon-4 = 5;
icon-5 = 6;
icon-6 = 7;
icon-7 = 8;
icon-8 = 9;
icon-9 = 10;
icon-default = 
