From 29d6a73d75aa87c0f8c5333d04e516d1115ed434 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Sat, 20 Oct 2018 14:13:51 -0400 Subject: [PATCH] polybar: Use inheritance for bars Maybe this is a new feature of polybar, or maybe I've never read the documentation thoroughly enough. This commit adds inheritance for my floating bar and top bar, so that duplication isn't necessary. This makes things a lot easier to see and understand. There is also a way to include other files, which may be useful for automatically generating key value pairs for polybar based on screen resolution. It may also be used to set different variables (i.e. colors) based on which bar is used. Pretty handy. --- .config/polybar/config | 42 +++++++++++------------------------------- 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/.config/polybar/config b/.config/polybar/config index fb2a9d07..1c91c2fc 100644 --- a/.config/polybar/config +++ b/.config/polybar/config @@ -13,42 +13,21 @@ text = ${xrdb:color7} background-alt = ${xrdb:color8} [bar/main] -modules-left = bspwm -modules-center = mpd -modules-right = cpu ram volume date time - -monitor = VGA-1 -foreground = ${color.text} -background = ${color.background} -font-0 = "Fira Mono:style=Bold:size=19" -font-1 = "Noto Sans CJK JP:size=19" -font-2 = "Font Awesome 5 Free:style=Solid:size=19" -font-3 = "Font Awesome 5 Free:style=Regular:size=19" -font-4 = "Font Awesome 5 Brands:style=Regular:size=19" - -# NOTE: You may want to change height to 80 if you don't want float -# Also do a grep for 80 and change the other places as well -height = 85 -padding-left = 2 -padding-right = 2 -module-margin = 1 -border-color = 66FFFFFF +inherit = bar/secondary # Make the bar float -# NOTE: offset-x should be the same as window_gap in your bspwmrc +# offset-x = offset-y = window_gap in bspwmrc +# width = screen resolution - offset-x * 2 +# border-size = border_width in bspwmrc +# border-bottom-size = border-size / 2 +# line-size = border-size / 2 offset-x = 30 -# NOTE: offset-y depends on window_gap as well; it's usually the same as offset-x offset-y = 30 -# NOTE: width = screen resolution - offset-x * 2 width = 3780 -# NOTE: border-size should be the same as border_width in your bspwmrc -border-size = 3 - +border-size = 8 +border-bottom-size = 4 line-size = 4 -# Make fullscreen programs show above polybar -wm-restack = bspwm - [bar/secondary] modules-left = bspwm modules-center = mpd @@ -67,10 +46,11 @@ height = 80 padding-left = 2 padding-right = 2 module-margin = 1 -border-color = ${color.background} -border-bottom-size = 0 +border-color = ${color.background-alt} +border-bottom-size = 4 # line-size = 4 +# Make fullscreen programs show above polybar wm-restack = bspwm [module/bspwm]