In polybar, is there a way to have the time and the date display in different fonts?
- User
In polybar, is there a way to have the time and the date display in different fonts?
- Assistant
Yes, you can set different fonts for the time and date modules in your polybar configuration file. Here's an example:
[module/time] type = internal/date format = %H:%M font-0 = Noto Sans:size=11 format-underline = #fff [module/date] type = internal/date format = %a %d %b font-0 = Inconsolata:size=10 format-underline = #fffIn this example, the
timemodule uses theNoto Sansfont at size11, while thedatemodule uses theInconsolatafont at size10. Note that the font name and size are separated by a colon (:) in thefont-Xsetting.You can adjust the font settings to your liking, but make sure to use a valid font name and size.
- User
Nice. Is there a way to have different separator widths between individual modules?
- Assistant
Yes, you can set different separator widths between individual modules in your polybar configuration file. Here's an example:
[bar/mybar] width = 100% height = 26 foreground = #fff background = #222 [module/left] type = custom/script exec = echo "left module" ... [module/right] type = custom/script exec = echo "right module" ...To set different separator widths between
leftandrightmodules, you can add theseparatorparameter to each module and specify aleftorrightvalue. For example:[bar/mybar] width = 100% height = 26 foreground = #fff background = #222 [module/left] type = custom/script exec = echo "left module" separator = right separator-foreground = #aaa separator-width = 2 ... [module/right] type = custom/script exec = echo "right module" separator = left separator-foreground = #bbb separator-width = 4 ...In this example, the
leftmodule uses a 2-pixel wide separator with a gray color, while therightmodule uses a 4-pixel wide separator with a lighter gray color. Note that theseparator-widthparameter specifies the width in pixels.