Have you tried to change tmux clock’s color by command in tmux or remotely?

<Prefix>:setw -g clock-mode-colour red
$ tmux setw -g clock-mode-color red

I was bored and playing with tmux commands to see if I could find something interesting. The clock’s color didn’t look good, too bright. I changed it with tmux command. That’s when something struck me, an indication of working hours, but it’s not about the clock only. I thought about cron task which changes tmux clock or the color or format of tmux status bar. It’s achievable because you can execute tmux command outside of the session or the server.

So, I made this video:

https://i.ytimg.com/vi/2_1iItA6-Co/hqdefault.jpg

With this code:

#!/bin/bash
SOCKET_NAME=default
cur_min="1$(date +%M)"
cur_min=$(($(date +%l) * 60 + cur_min - 100))
if ((cur_min < 9 * 60)) || ((cur_min >= 17 * 60)); then
  # It's fun time!
  tmux -L "$SOCKET_NAME" setw -g clock-mode-colour colour46
else
  # Build the color map
  colors=({231..201..-6} {200..196..-1} {202..226..6} {190..82..-36})
  idx=$((${#colors[@]} * (cur_min - 9 * 60) / (8 * 60)))
  tmux -L "$SOCKET_NAME" setw -g clock-mode-colour "colour${colors[idx]}"
  echo " $cur_min $idx"
fi

You need a terminal supports 256 color mode. I believe you could think of more creative way of using tmux clock. You may add text to status bar to remind you of something, or have tiny animation? A bouncing stuff?

I don’t like the clock style, I wonder if there is a way to change it’s font (if you can call that). Something rounder, smoother.

By the way. The screencast is powered by libfaketime. I was thinking how to make the clock run faster but without touching system clock. Changing system clock is a bad idea, no matter it’s on desktop/home computer or server. I found this library which can fake time. But the screencast is a fake on fake. tmux receives the fake time from libfaketime, however date, in the script above, receives real time instead of faked time from the library, so I set up a fake input, namely it didn’t use date in that video. A short script to set up tmux and set pane 0 to clock mode and to load a fake script to change clock colour in pane 1.