[colors]
# background = ${xrdb:background}
background = #902A253E
foreground = ${xrdb:color7}
accent = #958485CE
text = #9baec8

[settings]
screenchange-reload = true

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


# //////////////////////////////////////
[bar/top]
# xrandr -q | grep " connected" | cut -d ' ' -f1
#monitor = ${env:MONITOR:VGA-1}
monitor = ${env:MONITOR:monitor-fallback}
monitor-fallback = VGA-1
#monitor-fallback = HDMI1
#monitor-strict = false
width = 100%
height = 24
offset-x = 0
offset-y = 0
fixed-center = true
bottom = false
#locale = ru_RU.UTF-8

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

line-size = 0
line-color = #f00

border-size = 0
border-color = #00000000

padding-left = 0
padding-right = 0

module-margin-left = 5
module-margin-right = 0

font-0 = "ClearSansMedium:size=9:antialias=false;2"
# Cat unicode: echo -e "\uF31A"
font-1 = "Font Awesome 6 Free:style=Regular:pixelsize=8;2"
font-2 = "Font Awesome 6 Free:style=Solid:pixelsize=8;2"
font-3 = "Font Awesome 6 Brands:pixelsize=8;2"
font-4 = "Hack Nerd Font Mono:pixelsize=8:antialias=false;2"


modules-left = app term rss cpu memory uparch
modules-center = bspwm
modules-right = tor mpd alsa date xkeyboard power

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

wm-restack = bspwm
override-redirect = false
enable-ipc = true
# "polybar-msg cmd toggle" hide/show bar
# dock = true


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

ws-icon-0 = I;
ws-icon-1 = II;
ws-icon-2 = III;
ws-icon-3 = IV;
ws-icon-4 = V;
ws-icon-5 = VI;
ws-icon-6 = VII;
ws-icon-7 = VIII;
ws-icon-8 = IX;
ws-icon-9 = X;
ws-icon-default = 

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

label-focused = %icon%
label-focused-background = ${colors.accent}
label-focused-foreground = ${xrdb:color7}
# label-focused-underline= #ddd
label-focused-padding = 4

label-occupied = %icon%
label-occupied-foreground = ${colors.accent}
label-occupied-padding = 4

label-urgent = %icon%
label-urgent-foreground = ${xrdb:color5}
label-urgent-padding = 4

label-empty = %icon%
label-empty-foreground = ${colors.text}
label-empty-padding = 4



[module/uparch]
type = custom/script
exec = ~/.config/bspwm/polybar/uparch.sh
interval = 600
format-prefix = " "
format-prefix-foreground = ${colors.accent}
click-left = "urxvt -name Pacui -e ~/.bin/pacui &"



[module/tor]
type = custom/script
exec = ~/.config/bspwm/status tor
interval = 6
format = <label>
# format-padding = 1
click-left = "systemctl restart tor"
click-right = "systemctl stop tor"



[module/title]
type = internal/xwindow
format-padding = 1
label = "%title:0:20:...%"
label-maxlen = 20


[module/term]
type = custom/text
content = 
content-foreground = ${colors.accent}
# click-left = "urxvt -name tmux -geometry 190x50 -e tmux new -s proc -d ranger\; splitw -dv htop\; splitw -dh gotop\; splitw -dh\; attach &"
click-left = "urxvt -name Tmux -e sh -c 'tmux attach || tmux new -s work' &"
#click-right = "urxvt -name Tmux -e sh -c '~/.bin/rxrun.sh' &"



[module/app]
type = custom/text
content = 
content-foreground = ${xrdb:color7}
content-background = ${colors.accent}
content-padding = 3
click-left = rofi -show drun



[module/rss]
type = custom/text
content = 
content-foreground = ${colors.accent}
click-left = "urxvt -name Newsboat -e newsboat &"
click-right =



[module/cpu]
type = internal/cpu
interval = 2
format-prefix = " "
format-prefix-foreground = ${colors.accent}
label = %percentage%%



[module/memory]
type = internal/memory
interval = 2
format-prefix = " "
format-prefix-foreground = ${colors.accent}
label = %percentage_used%%



[module/alsa]
type = internal/alsa
format-volume = <ramp-volume> <label-volume>
format-muted =  0%
ramp-volume-0 = 
ramp-volume-1 = 
ramp-volume-2 = 
ramp-volume-foreground = ${colors.accent}



[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock
blacklist-1 = caps lock
format-prefix = " "
format-prefix-foreground = ${colors.accent}
label = %layout%



[module/power]
type = custom/text
content = 
content-foreground = ${xrdb:color7}
content-background = ${colors.accent}
content-padding = 3
click-left = ~/.config/bspwm/power



[module/mpd]
type = internal/mpd
host = 127.0.0.1
port = 6600
# password = mysecretpassword
interval = 2
format-online = <icon-prev> <icon-stop> <toggle> <icon-next>
label-offline =  mpd off
icon-play = 
icon-pause = 
icon-stop = 
icon-prev = 
icon-next = 
icon-play-foreground = ${colors.accent}
icon-pause-foreground = ${colors.accent}
icon-stop-foreground = ${colors.accent}
icon-prev-foreground = ${colors.accent}
icon-next-foreground = ${colors.accent}



[module/date]
type = internal/date
interval = 1
# date = "%e %b,"
date-alt = "%e %B %Y,"
time = "%H:%M"
time-alt = "%H:%M:%S"
format-prefix = " "
format-prefix-foreground = ${colors.accent}
# format-underline = #5294E2
label =%{A3:gsimplecal & disown:}%date% %time%%{A}
# label = %date% %time%
# format-background = #132332
label-foreground = ${colors.text}
# format-padding =
