[colors]
# background = ${xrdb:background}
background = #95000000
foreground = #AEB4C6

primary = #81A1C1
accent = #5E81AC
red = #BF616A
green = #A3BE8C
yellow = #EBCB8B
blue = #88C0D0
magenta = #B48EAD
cyan = #D08770
white = #ECEFF4
dark = #2E3440



[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 = Virtual1
#monitor-fallback = HDMI1
#monitor-strict = false
width = 100%
height = 28
offset-x = 0
offset-y = 0
fixed-center = true
bottom = false
#locale = ru_RU.UTF-8

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

line-size = 0
line-color = #f00

border-size = 0
border-color = #00000000

padding-left = 3
padding-right = 3

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

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


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

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

tray-position = right
tray-detached = false
tray-maxsize = 16
tray-background = ${colors.background}
tray-offset-x = 0
tray-offset-y = 0
tray-padding = 0
tray-scale = 1.0


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


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

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-mode = %mode%
label-mode-padding = 1

; focused = Active workspace on focused monitor
label-focused = %icon%
label-focused-foreground = ${colors.accent}
label-focused-background =
label-focused-underline = ${colors.primary}
label-focused-padding = 1

; unfocused = Inactive workspace on any monitor
label-unfocused = %icon%
label-unfocused-padding = 1

; visible = Active workspace on unfocused monitor
label-visible = %icon%
label-visible-foreground = ${self.label-focused-foreground}
label-visible-background = ${self.label-focused-background}
label-visible-underline = ${self.label-focused-underline}
label-visible-padding = ${self.label-focused-padding}

; urgent = Workspace with urgency hint set
label-urgent = %icon%
label-urgent-background = ${colors.accent}
label-urgent-padding = 1
# ##########################################


[module/fs]
type = internal/fs
mount-0 = /
mount-1 = /home
# mount-2 = /media/files
interval = 100
fixed-values = true
spacing = 2
format-mounted = <label-mounted>
format-unmounted = <label-unmounted>
label-mounted =  %used%
label-mounted-foreground = ${colors.accent}
label-unmounted = no mount
label-unmounted-foreground = ${colors.red}




[module/wtr]
type = custom/script
exec = ~/.config/i3/polybar/wtr.sh
format-foreground = ${colors.magenta}
# format-padding = 1
interval = 600
label-font = 0



[module/uparch]
type = custom/script
exec = ~/.config/i3/polybar/uparch.sh
interval = 600
format-prefix = " "
format-prefix-foreground = ${colors.red}
click-left = pamac-manager --updates



[module/ip]
type = custom/script
interval = 600
format = "<label>"
format-prefix = "ip: "
format-prefix-foreground = ${colors.magenta}
# format-padding = 1
exec = echo "$(wget -qO- https://canihazip.com/s | sed -e 's/[^[:digit:]\|.]//g')"
exec-if = ping -c 1 ya.ru



[module/tor]
type = custom/script
exec = ~/.config/i3/polybar/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.primary}
click-left = xfce4-terminal &
click-right = xfce4-terminal -e htop &



[module/app]
type = custom/text
content = 
content-foreground = ${colors.primary}
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



[module/rss]
type = custom/text
content = 
content-foreground = ${colors.primary}
click-left = xfce4-terminal -e newsboat &
click-right =



[module/web]
type = custom/text
content = 
content-foreground = ${colors.primary}
click-left = ~/.bin/findapp firefox &
click-right =



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



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



[module/temperature]
type = internal/temperature
thermal-zone = 0
warn-temperature = 60

format = <ramp> <label>
format-warn = <ramp> <label-warn>

label = %temperature%
label-warn = %temperature%
label-warn-foreground = ${colors.secondary}

ramp-0 = 
ramp-1 = 
ramp-2 = 
ramp-foreground = ${colors.primary}



[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.primary}



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



[module/power]
type = custom/text
content = 
content-foreground = ${colors.primary}
click-left = ~/.config/i3/polybar/power



[module/network]
type = internal/network
interface = enp2s5
interval = 1.0

# format-connected = "<ramp-signal> <label-connected>"
format-connected = "  <label-connected> "
format-packetloss = <animation-packetloss>
label-connected =  %upspeed:2% %downspeed:2%
# label-connected = %signal%%

ramp-signal-0 = 😱
ramp-signal-1 = 😠
ramp-signal-2 = 😒
ramp-signal-3 = 😊
ramp-signal-4 = 😃
ramp-signal-5 = 😈

animation-packetloss-0 = ⚠
animation-packetloss-0-foreground = #ffa64c
animation-packetloss-1 = 
animation-packetloss-1-foreground = #000000



[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.primary}
icon-pause-foreground = ${colors.primary}
icon-stop-foreground = ${colors.primary}
icon-prev-foreground = ${colors.primary}
icon-next-foreground = ${colors.primary}



[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.white}
# format-padding =
