Change the bar date/time format
You may prefer a different date/time format than what's set by default. This tutorial requires us to make a single change to the Xresource file that defines the date format used in the bar. The date is generated by the
date command, and the formatting options are documented here.
- Stage your own Xresource file (tutorial), then open
~/.Xresources-regolithin your editor of choice.
- The file should contain a single line which is an
#includeto another Xresource file. Let's copy the contents of that referenced file into our Xresource file rather than having the include. To do this, exit out of the editor and run
cp /etc/regolith/styles/cahuella/root ~/.Xresources-regolith
- Ok, now back in editing the file, it should look something like this:
! -- Styles - Colors #include "/etc/regolith/styles/cahuella/color" ! -- Styles - Fonts #include "/etc/regolith/styles/cahuella/typeface" ! -- Styles - Theme #include "/etc/regolith/styles/cahuella/theme" ! -- Applications ! These files map values defined above into specific app settings. #include "/etc/regolith/styles/st-term" #include "/etc/regolith/styles/i3-wm" #include "/etc/regolith/styles/i3xrocks" #include "/etc/regolith/styles/rofi" #include "/etc/regolith/styles/gnome"
- The setting we need to change is set in
/etc/regolith/styles/i3xrocks. Let's create our own copy of that and reference it from our Xresource file. You'll need to specify the path to the file explicitly, and cannot use
~/as a shortcut. First, update the line in your open editor to point to a file we haven't created yet:
…should be changed to:
#include "/home/[YOUR USER NAME]/.Xresources-i3xrocks"
- Now lets create that file:
$ cp /etc/regolith/styles/i3xrocks ~/.Xresources-i3xrocks
- Finally, we can edit the file to change the date format. Load ~/.Xresources-i3xrocks into a text editor, and change:
i3xrocks.date.format: + %m/%d %I:%M %p
…to your preferred date format, or this for just the time:
i3xrocks.date.format: + %I:%M %p
After saving the file, you can run
regolith-look refresh or
xrdb -merge ~/.Xresources-regolith for the changes to take effect. You can verify that the setting was changed by checking the value on the command line:
$ xrescat i3xrocks.date.format
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.