0

Context:

I'm running ArcoLinux with i3 as my window manager and polybar as my bar. During installation I chose the language to be English, America en_us.

And Locale I chose Brazil, São Paulo.

If I run on terminal locale I get the output as shown bellow:

LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC=pt_BR.UTF-8
LC_TIME=pt_BR.UTF-8
LC_COLLATE="en_US.utf8"
LC_MONETARY=pt_BR.UTF-8
LC_MESSAGES="en_US.utf8"
LC_PAPER=pt_BR.UTF-8
LC_NAME=pt_BR.UTF-8
LC_ADDRESS=pt_BR.UTF-8
LC_TELEPHONE=pt_BR.UTF-8
LC_MEASUREMENT=pt_BR.UTF-8
LC_IDENTIFICATION=pt_BR.UTF-8
LC_ALL=

And if I run the command date I get:

sex 04 set 2020 10:31:27 -03

My polybar config for the date module is:

[module/date]
;https://github.com/jaagr/polybar/wiki/Module:-date
type = internal/date
; Seconds to sleep between updates
interval = 5
; See "http://en.cppreference.com/w/cpp/io/manip/put_time" for details on how to format the date string
; NOTE: if you want to use syntax tags here you need to use %%{...}
date = "%a %d/%m  %t"
;date-alt = "%x"
time = %H:%M
;time-alt = %H:%M
format-prefix = " "
format-prefix-foreground = ${colors.foreground}
;format-underline = #c1941a
;format-underline =${colors.foreground}
format-foreground = ${colors.foreground}
format-background = ${colors.background}
label = %date% %time%

And yet my output on my bar is polybar date module

How can I get date format in polybar to actually be as in the date command? It should be like it, right?

1 Answer 1

0

You can set the locale for the entire bar, by setting the locale key in the bar section. In your case that would be locale = pt_BR.UTF-8.

I am not aware of a way to set the locale just for the date module.

How can I get date format in polybar to actually be as in the date command? It should be like it, right?

The date module is not the same as the date command. Internally polybar used C++'s std::put_time, which has some differences compared to the date command.

1
  • Thank you. This actually solved. I thought it would default to system locale's and the default configuration didn't come with the locale option.
    – crazytelli
    Sep 5, 2020 at 1:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .