Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add date and time customization #21

Closed
samarulmeu opened this issue Feb 7, 2022 · 17 comments · Fixed by #31
Closed

feat: add date and time customization #21

samarulmeu opened this issue Feb 7, 2022 · 17 comments · Fixed by #31
Assignees

Comments

@samarulmeu
Copy link

Will it be possible (already exists?) a possibility to change date and time display? For example have something like %d.%m.%Y.

Thank you!

@egel
Copy link
Owner

egel commented Sep 9, 2024

Hi @samarulmeu, thanks so much for the issue.

TLDR; I can simply answer, yes! 🙂

I am currently working on enhancing the theme to provide more customization options to the theme. I imagine there will be an easy way to customize the desired slot with time to fit your needs.

If you are interested, you may take a look at #30 to see more.

Best

@samarulmeu
Copy link
Author

Hi @egel!

Thank you for your help! Waiting for the setting to be available!

Good work!

@egel egel self-assigned this Sep 9, 2024
@egel egel changed the title Date and time customization feat: add date and time customization Sep 19, 2024
@egel
Copy link
Owner

egel commented Sep 19, 2024

Hey @samarulmeu, this feature should be already available for tests in release/v2-0-0 branch. Feel free to try it out 🙂

@samarulmeu
Copy link
Author

Only now I've seen your comment.

I'm using an automated plugin update, but for last days I get an error when trying to update

"tmux-gruvbox" update fail
    | fatal: couldn't find remote ref refs/heads/master

It seems you've renamed the branch. Should I do something?

@egel
Copy link
Owner

egel commented Sep 25, 2024

Hi @samarulmeu, and thanks for the feedback. Oh yes, some time ago I decided to migrate from master to main as the primary branch and did not update the master for a while then - therefore recently thought to clean it out. I am sorry for this inconvenience.

I think the simplest way would be to:

  • remove the plugin rm -rf ~/.tmux/plugins/tmux-gruvbox
  • and reinstall it again via tpm key-binding <prefix> + I.

feel free to let me know if this worked for you.

Or if you plan to test the upcoming release branch with time adjustments - but then you may need to manually pull the repo and link it (see dev section).

@samarulmeu
Copy link
Author

Thank you, @egel! Everything went smooth in upgrading. I am still waiting for the adjustments to hit the stable branch.

@egel
Copy link
Owner

egel commented Sep 26, 2024

Awesome, happy this worked for you @samarulmeu.

And yeah, same! I also want to push this to main! As I am so excited to give those new great things to you all.

Although there are a couple of things that still need to be considered e.g.: btw that you remind me, what if someone is using old versions, or if someone's terminal does not support 16bit colors - so aka potential migration guide.
generally, I do not expect huge changes (I tried to keep compatibility as much as possible), but there will be slight differences in themes, and people need to know them and feel comfortable :)

Also, feel free to leave feedback if you try out the release/v2.0.0. I am so much open to constructive critique and suggesting better solutions.

@samarulmeu
Copy link
Author

I think that a migration guide is also necessary.

Keep up the good woork!

@samarulmeu
Copy link
Author

samarulmeu commented Sep 26, 2024

Hi @egel!

I tried to test the 2.0.0 version but I can not set the date as I wanted. This is the setting i put in my tmux.conf

set -g @tmux-gruvbox-right-status-x '%d-%m-%Y'

With this the date is something like Thu 26 Sep 2024

Should I do something more or the setting is not right?

@egel
Copy link
Owner

egel commented Sep 26, 2024

Hmm... very interesting. what timezone, OS, and terminal emulator do you use?

generally whatever I tried so far with %d-%m-%Y gives me the same results format following DD-MM-YYYY both for macOS & linux Ubuntu (checked with alacritty & iTerm).

also tested successfully with different using date with different timezone & separators like e.g. .

set -g @tmux-gruvbox-right-status-x '#(TZ="America/Chicago" date +%d.%m.%Y)'

if this is also not working, try with double %%, as this could be related to interpolation with displaying different timezones (source).

set -g @tmux-gruvbox-right-status-x '#(date +%%d.%%m.%%Y)'

Of course, the timezone below is not required, just to demonstrate purpose.

set -g @tmux-gruvbox-right-status-x '#(TZ="America/Chicago" date +%%d.%%m.%%Y)'

@samarulmeu
Copy link
Author

Hi @egel!

I am using xterm in Devuan Linux.

In the end it seems to work, but now I get some differences in the color palette.

This is the old status bar

old

and this one is with v2

new

Did something change or it is still something on my part?

@egel
Copy link
Owner

egel commented Sep 26, 2024

yes, therefore I saw the inevitable need & explanation in the migration guide before the official release. ;)

in v2 will support a 16-bit color palette to get a richer color experience, therefore the light theme will use 16-bit colors.
if you are interested in using only 256 color palettes feel free to set the theme to light256.

@samarulmeu
Copy link
Author

Thank you for your explanation. All of this should be added to the migration guide.

Let's see how it goes! I will be back with feedback after the release.

@egel
Copy link
Owner

egel commented Dec 1, 2024

done, closing after merging release/v2.0.0

@egel egel closed this as completed Dec 1, 2024
@samarulmeu
Copy link
Author

@egel Hello!

I am trying to display the date in local format but with no success.

Here is my code

#set -g @tmux-gruvbox-right-status-x '#(LC_TIME="ro_RO.UTF-8" date +"%A, %e %B %Y")'

I tried even this:

set -g @tmux-gruvbox-right-status-x '#(export LC_ALL="ro_RO.UTF-8" date +"%A, %e %B %Y")'

Thank you!

@egel
Copy link
Owner

egel commented Dec 8, 2024

Hi @samarulmeu!

Sorry to hear that it doesn't work out of the box. I had some problems with simulating your Devuan Linux (xterm) config on my silicon mac - it just doesn't work...
Currently, I am lacking a free/unused amd64 CPU, in order to simulate it.

Have you maybe tried with double % as I mentioned in README section for date? Someone already mentioned this to me once, some systems require this trick, therefore I put this info there.
Try maybe with something like the below - although must mention I have no idea without a test environment if this would even work:

set -g @tmux-gruvbox-right-status-x '#(date +"%%A, %%e %%B %%Y")'

@samarulmeu
Copy link
Author

Hi @egel!

Thank you for your answer. Indeed using the double % worked and now I have localized date. Maybe you should add this in the configuration information.

All the best!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants