24h clock in prompt?
I grepped around, but I can't figure out why my prompt is a 12h clock. My LC_TIME variable is en_US.UTF-8 though, which gives a 24clock to my date command.
So the question is, how to get to a 24h clock.
I grepped around, but I can't figure out why my prompt is a 12h clock. My LC_TIME variable is en_US.UTF-8 though, which gives a 24clock to my date command.
That is because the clock in the Bash prompt is independent of the date command and does not use LC_TIME. In the Bash prompt, the time format is explicitly specified by \t, \T, \@, \A, or \D{format} (See Controlling the Prompt (Bash Reference Manual)). There is no prompt sequence that uses LC_TIME.
The actual prompt sequence used to show the time in your prompt depends on the theme you use. What is your theme, i.e., what is the result of echo "$OSH_THEME"?
So the question is, how to get to a 24h clock.
After identifying the theme you use, you can check README.md of the theme (if any) or the source code of the theme (which is typically located at "$OSH"/themes/<theme_name>/<theme_name>.theme.sh) to see if there is a configuration to configure the time format. If yes, you can use the configuration to specify the time format. If not, you can modify the theme following the instructions on "Customization of Plugins and Themes" - README.
thank you , that was helpful!
I wind up adding THEME_CLOCK_FORMAT=${THEME_CLOCK_FORMAT:-"%H:%M:%S"} to the custom/example.sh file. Now I have my time
I'm really liking this project. Of course I had my own much simpler version, but there's one thing I do a lot, and load projects on demand via my own "rc" alias. Without arguments it will list all rc files in my ~/rc directory, and something like
rc foobar
will source the ~/rc/foobar.rc file. It is a little akin to the module load command, just less typing and less maintenance for me. Is there something like this in omb, or could we make it an addition.
- peter
On Sun, Jun 1, 2025 at 3:41 PM Koichi Murase @.***> wrote:
akinomyoga left a comment (ohmybash/oh-my-bash#688) https://github.com/ohmybash/oh-my-bash/issues/688#issuecomment-2927761381
I grepped around, but I can't figure out why my prompt is a 12h clock. My LC_TIME variable is en_US.UTF-8 though, which gives a 24clock to my date command.
That is because the clock in the Bash prompt is independent of the date command and does not use LC_TIME. In the Bash prompt, the time format is explicitly specified by \t, \T, @, \A, or \D{format} (See Controlling the Prompt (Bash Reference Manual) https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html). There is no prompt sequence that uses LC_TIME.
The actual prompt sequence used to show the time in your prompt depends on the theme you use. What is your theme, i.e., what is the result of echo "$OSH_THEME"?
So the question is, how to get to a 24h clock.
After identifying the theme you use, you can check README.md of the theme (if any) or the source code of the theme (which typically is located at "$OSH"/themes/<theme_name>/<theme_name>.theme.sh) to see if there is a configuration to configure the time format. If yes, you can use the configuration to specify the time format. If not, you can modify the theme following the instructions on "Customization of Plugins and Themes" - README.
— Reply to this email directly, view it on GitHub https://github.com/ohmybash/oh-my-bash/issues/688#issuecomment-2927761381, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZ4MGJDEF4EPQAIADRON5D3BNJPLAVCNFSM6AAAAAB6LNHHF6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSMRXG43DCMZYGE . You are receiving this because you authored the thread.Message ID: @.***>
Is there something like this in omb,
The function _omb_module_require is internally used.
or could we make it an addition.
There is a skeleton implementation of omb in lib/omb.bash. You can add implementations in _omb_cmd_module or something to offer the interface with omb module load, omb module list, etc.