[colors]
# background = ${xrdb:background}
background = #000000
foreground = #ffffff
accent = #798BC7
text = #9baec8
light = #d5d6d7
suffix = #ff0404

[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 = 20
offset-x = 0
offset-y = 0
fixed-center = true
bottom = false
#locale = ru_RU.UTF-8

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

line-size = 1
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 = "UW Ttyp0:style=Regular:size=8:antialias=false;2"
font-0 = "Ubuntu:style=Bold:size=8:antialias=false;2"
#font-2 = "Siji:pixelsize=8;1"
# 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"
# font-5 = "Weather Icons:style=Regular:pixelsize=9;2"


modules-left = app cpu memory uparch title
modules-center = workspaces mpd
modules-right = bri_sh fs tor alsa battery 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

# tray-position = right
# tray-padding = 1
# tray-transparent = false
# tray-background = #000000
# tray-detached = false
# tray-maxsize = 16
# tray-scale = 1.0


# ##########################################
[module/app]
type = custom/text
content = 
content-foreground = ${colors.accent}
content-background = ${xrdb:color0}
content-padding = 3
click-left = rofi -modi run,drun -show drun -location 1 -xoffset 15 -yoffset 39 -line-padding 4 -columns 1 -width 25 -lines 10 -padding 15 -hide-scrollbar -show-icons -drun-icon-theme
# click-right = "~/.config/rofi/scripts/apps.sh &"



[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/uparch]
type = custom/script
exec = ~/.config/frankenwm/polybar/uparch.sh
interval = 600
format-prefix = " "
format-prefix-foreground = ${colors.accent}
click-left = "urxvt -e yay -Syyu &"
click-right = "urxvt -name Pacui -e pacui &"

# [module/pkg]
# type = custom/script
# exec = updates.sh
# exec-if = "ping -q -w 2 -c 1 176.34.135.167 > /dev/null"
# label = %{A1:urxvt -e "yay -Syyu" & disown:} %{A3:urxvt -name "Pacui" -e "pacui" & disown:}%{F#B48EAD}%{F-} %output%%{A} %{A}
# tail = true



[module/wtr]
type = custom/script
exec = ~/.config/frankenwm/polybar/wtr.sh
format-foreground = ${colors.text}
# format-padding = 1
interval = 600
# label-font = 5
# click-left =



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


[module/workspaces]
type = internal/xworkspaces
pin-workspaces = true
enable-click = true
enable-scroll = true

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 = 

format = <label-state>

label-active = %icon%
label-active-foreground = ${colors.accent}
label-active-background = ${xrdb:color0}
label-active-underline = ${colors.accent}
label-active-padding = 3

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

label-occupied = %icon%
label-occupied-foreground = ${colors.accent}
label-occupied-background = ${xrdb:color0}
label-occupied-padding = 3

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



[module/mpd_sh]
type = custom/text
content = 
content-foreground = ${colors.accent}
content-background = ${xrdb:color0}
content-padding = 3



[module/mpd]
type = internal/mpd
interval = 2
format-online = <label-song>    <icon-prev>   <toggle>   <icon-next>
format-online-padding = 0
label-song =  "%artist% - %title%"
label-song-maxlen = 25
label-song-ellipsis = true
label-offline = " mpd off"
label-song-foreground = ${colors.text}

icon-play = 
icon-pause = 
icon-stop = 
icon-prev = 
icon-next = 
icon-seekb =
icon-seekf =
icon-random =
icon-repeat =
icon-repeatone =
icon-single =
icon-consume =
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/bri_sh]
type = custom/text
content = 
content-foreground = ${colors.accent}
content-background = ${xrdb:color0}
content-padding = 3
click-left = "pkill -9 redshift; ~/.bin/bri.sh 0.7 0.9:0.9:0.9 &"
click-right = "~/.bin/bri.sh 1 1:1:1; pkill -9 redshift &"



[module/fs]
type = internal/fs
mount-0 = /
# mount-1 = /home
# mount-2 = /media/files
interval = 10
fixed-values = true
spacing = 1
format-mounted = <label-mounted>
format-mounted-prefix = 
format-mounted-padding = 1
format-mounted-prefix-foreground = ${colors.accent}
format-unmounted = <label-unmounted>
format-unmounted-prefix = 
format-unmounted-padding = 1
format-unmounted-prefix-foreground = ${colors.suffix}
label-mounted = " %free%"
label-unmounted = %mountpoint%: not mounted
label-unmounted-foreground = ${colors.text}



[module/tor]
type = custom/script
exec = ~/.config/frankenwm/polybar/status tor
interval = 6
format = <label>
format-prefix = "  "
format-prefix-foreground = ${colors.accent}
format-padding = 0
click-left = "systemctl restart tor &"
click-right = "systemctl stop tor &"



[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/battery]
# https://github.com/jaagr/polybar/wiki/Module:-battery
type = internal/battery
# ls -1 /sys/class/power_supply/
battery = BAT0
adapter = AC
poll-interval = 2
time-format = %H:%M
full-at = 99

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

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

format-full-prefix = " "
format-full-prefix-foreground = ${colors.accent}

ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-3 = 
ramp-capacity-4 = 
ramp-capacity-foreground = ${colors.accent}

animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-3 = 
animation-charging-4 = 
animation-charging-foreground = ${colors.accent}
animation-charging-framerate = 700



[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 = 0



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



[module/power]
type = custom/text
content = 
content-foreground = ${colors.accent}
content-background = ${xrdb:color0}
content-padding = 3
click-left = "~/.config/frankenwm/polybar/power &"
click-right= "~/.bin/multilock.sh -l blur &"
