You are not logged in.

#1 2021-11-24 03:30:55

mimimidashu
Member
Registered: 2021-11-24
Posts: 1

polybar i3 module: different monitor use different color

I'm using archlinux + i3 + polybar, and have two monitors, below is my polybar launcher.sh:

if type "xrandr"; then
    for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
        MONITOR=$m polybar --reload example 2>&1 >/tmp/polybar-example.$m.log &
    done
else
    polybar --reload example 2>&1 >/tmp/polybar-example.log &
fi
[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = false

label-mode-padding = 2
label-mode-foreground = #000
label-mode-background = ${colors.primary}

; focused = Active workspace on focused monitor
label-focused = %index%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
label-focused-padding = 2

; unfocused = Inactive workspace on any monitor
label-unfocused = %index%
label-unfocused-padding = 2

; visible = Active workspace on unfocused monitor
label-visible = %index%
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 = %index%
label-urgent-background = ${colors.alert}
label-urgent-padding = 2

the script works fine on two monitors, but I'm wondering is there any way to make i3 workspace indicator distinguish different monitor, such as: workspace focused by monitor eDP-1 use red color, workspace focused by HDMI-1 use green color

Thanks

Offline

Board footer

Powered by FluxBB