nordtheme / tmux

An arctic, north-bluish clean and elegant tmux color theme.
https://www.nordtheme.com/ports/tmux
MIT License
1.06k stars 141 forks source link

Configurable time and date visibility #75

Open flohw opened 1 year ago

flohw commented 1 year ago

Hello,

I use your theme everywhere I can : i3, JetBrains and tmux. So it's time to contribute to one of the configuration. :slightly_smiling_face:

As I put my date and time in my i3 bar, I don't want to have it in my tmux.

I propose this patch to add some configuration in order to only have date, time or both displayed and keep a clean look. Both is the default to get some backward compatibility.

Here are some screen for the different possible configuration.

variation patched font enabled non patched font
time and date both enabled with patched font both enabled without patched font
time only time only with patched font time only without patched font
date only date only with patched font date only without patched font
none none with patched font none without patched font

Colors may look darker because my background is dark and my terminal background is transparent.

I refactored a bit for the NORD_TMUX_STATUS_DATE_FORMAT to prevent too many deep ifs and set my two new variables the same way.

I made an attempt on my machine to get a neater status-right value but it didn't worked so I ended up doing like so but if anyone has better to propose, I'll be happy to make some changes. As you can see I was forced to explode the different #[fg=...,bg=...] into multiple #[fg=...]#[bg=...]... otherwise it didn't work.

A last thing that I didn't understood is that you put tmux set-environment -gu NORD_TMUX_STATUS_TIME and same for date and everything works as expected, we can change the option, reload configuration and changes is made. I tried to add my two new variables but in this case they are always considered as 0 so nothing is displayed. Again, if anyone can give me the answer, I'll be happy to learn.

Thank you!