brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: Ctrl-b t shows a big clock and clock-mode-style sets its format

Tmux
~/tips/tip-tmux-clock-mode-style

tmux clock-mode

Shows a large clock in a tmux pane, in 12 or 24 hour format, with or without seconds.

tmux has a full-pane clock that is easy to hit by accident. I like it as a cheap wall clock, as long as it shows the time the way I read it.

The default key table lists Ctrl-b t as “Show the time”. From the command line the same thing is:

tmux clock-mode

The window option clock-mode-style sets the hour format and takes 12, 24, 12-with-seconds or 24-with-seconds. The colour comes from clock-mode-colour.

setw -g clock-mode-style 24-with-seconds
setw -g clock-mode-colour green

The two seconds variants are handy when you time something in another pane. Check the current style with tmux show -gwv clock-mode-style. Add both lines to your config and the clock looks the same in every session. The command also takes -t with a target pane, so a spare pane on a second monitor can show the time while you work elsewhere:

tmux clock-mode -t main:2.0

The clock takes over the pane it runs in, so pick an empty pane for it and not the one with your editor. The target main:2.0 is session main, window 2, pane 0, and tmux list-panes -a shows the targets you have.

Further reading: tmux manual

Going deeper: Guide: advanced tmux, a config that grows with you, formats, layouts and more

More Tmux tips tmux new -d -s report -x 200 -y 50 'top' tmux wait-for build-done set -g allow-passthrough on tmux kill-server Ctrl-b [ All Tmux tips (125) All topics

Link