Split polybar in 3 different bars and simplified them

Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
This commit is contained in:
Louis Vallat 2021-11-18 12:21:01 +01:00
parent 57b0d74063
commit e954fad819
No known key found for this signature in database
GPG Key ID: 0C87282F76E61283
2 changed files with 67 additions and 28 deletions

View File

@ -19,17 +19,22 @@ for DISP in ${DISPLAYS}; do
done done
killall -q polybar killall -q polybar
if [ ${EXT_PRIMARY} != "" ]; then if [ "${EXT_PRIMARY}" != "" ]; then
xrandr --output ${EXT_PRIMARY} --primary --output eDP --right-of ${EXT_PRIMARY} xrandr --output ${EXT_PRIMARY} --primary --output eDP --right-of ${EXT_PRIMARY}
bspc monitor ${EXT_PRIMARY} -d I II III IV V bspc monitor ${EXT_PRIMARY} -d I II III IV V
bspc monitor eDP -d VI VII VIII IX X bspc monitor eDP -d VI VII VIII IX X
MONITOR="eDP" polybar main 2>&1 | tee -a /tmp/polybar.log & disown MONITOR=${EXT_PRIMARY} polybar left 2>&1 | tee -a /tmp/polybar.log & disown
MONITOR=${EXT_PRIMARY} polybar ext 2>&1 | tee -a /tmp/polybar.log & disown MONITOR=${EXT_PRIMARY} polybar center 2>&1 | tee -a /tmp/polybar.log & disown
MONITOR=${EXT_PRIMARY} polybar right 2>&1 | tee -a /tmp/polybar.log & disown
else else
bspc monitor eDP -d I II III IV V VI VII VIII IX X bspc monitor eDP -d I II III IV V VI VII VIII IX X
MONITOR="eDP" polybar main 2>&1 | tee -a /tmp/polybar.log & disown
fi fi
MONITOR="eDP" polybar left 2>&1 | tee -a /tmp/polybar.log & disown
MONITOR="eDP" polybar center 2>&1 | tee -a /tmp/polybar.log & disown
MONITOR="eDP" polybar right 2>&1 | tee -a /tmp/polybar.log & disown
bspc config border_width 0 bspc config border_width 0
bspc config top_padding 34 bspc config top_padding 34
bspc config window_gap 8 bspc config window_gap 8

View File

@ -27,14 +27,13 @@ primary = #ffb52a
secondary = #e60053 secondary = #e60053
alert = #bd2c40 alert = #bd2c40
[bar/left]
[bar/main]
monitor = ${env:MONITOR:eDP} monitor = ${env:MONITOR:eDP}
width = 100% width = 12%
height = 27 height = 27
;offset-x = 1% ;offset-x = 1%
;offset-y = 1% ;offset-y = 1%
radius = 6.0 radius = 3.0
fixed-center = false fixed-center = false
background = ${colors.background} background = ${colors.background}
@ -52,11 +51,8 @@ module-margin-left = 1
module-margin-right = 2 module-margin-right = 2
font-0 = FiraCode Nerd Font:style=medium:size=10 font-0 = FiraCode Nerd Font:style=medium:size=10
font-1 = siji:pixelsize=10;1
modules-left = bspwm modules-center = date
modules-center = xwindow
modules-right = filesystem pulseaudio xkeyboard memory cpu wlan eth battery date powermenu
tray-position = right tray-position = right
tray-padding = 2 tray-padding = 2
@ -76,13 +72,13 @@ wm-restack = bspwm
cursor-click = pointer cursor-click = pointer
cursor-scroll = ns-resize cursor-scroll = ns-resize
[bar/ext] [bar/center]
monitor = ${env:MONITOR:DisplayPort-2} monitor = ${env:MONITOR:eDP}
width = 100% width = 30%
height = 27 height = 27
;offset-x = 1% offset-x = 35%
;offset-y = 1% ;offset-y = 1%
radius = 6.0 radius = 3.0
fixed-center = false fixed-center = false
background = ${colors.background} background = ${colors.background}
@ -100,11 +96,52 @@ module-margin-left = 1
module-margin-right = 2 module-margin-right = 2
font-0 = FiraCode Nerd Font:style=medium:size=10 font-0 = FiraCode Nerd Font:style=medium:size=10
font-1 = siji:pixelsize=10;1
modules-left = bspwm modules-center = bspwm
modules-center = xwindow tray-position = right
modules-right = filesystem pulseaudio xkeyboard memory cpu wlan eth battery date powermenu tray-padding = 2
;tray-background = #0063ff
wm-restack = bspwm
;wm-restack = i3
;override-redirect = true
;scroll-up = bspwm-desknext
;scroll-down = bspwm-deskprev
;scroll-up = i3wm-wsnext
;scroll-down = i3wm-wsprev
cursor-click = pointer
cursor-scroll = ns-resize
[bar/right]
monitor = ${env:MONITOR:eDP}
width = 23%
height = 27
offset-x = 77%
;offset-y = 1%
radius = 3.0
fixed-center = false
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3
line-color = #f00
border-size = 4
border-color = #00000000
padding-left = 0
padding-right = 2
module-margin-left = 1
module-margin-right = 2
font-0 = FiraCode Nerd Font:style=medium:size=10
modules-center = pulseaudio memory cpu wlan eth battery
tray-position = right tray-position = right
tray-padding = 2 tray-padding = 2
@ -124,6 +161,7 @@ wm-restack = bspwm
cursor-click = pointer cursor-click = pointer
cursor-scroll = ns-resize cursor-scroll = ns-resize
[module/xwindow] [module/xwindow]
type = internal/xwindow type = internal/xwindow
label = %title:0:50:...% label = %title:0:50:...%
@ -255,19 +293,15 @@ format-disconnected =
[module/date] [module/date]
type = internal/date type = internal/date
interval = 5 interval = 1
date = date = " %Y-%m-%d %H:%M:%S"
date-alt = " %Y-%m-%d"
time = %H:%M
time-alt = %H:%M:%S
format-prefix =  format-prefix = 
format-prefix-foreground = ${colors.foreground-alt} format-prefix-foreground = ${colors.foreground-alt}
format-underline = #0a6cf5 format-underline = #0a6cf5
label = %date% %time% label = %date%
[module/pulseaudio] [module/pulseaudio]
type = internal/pulseaudio type = internal/pulseaudio