Tmux DND Status
Tmux plugin that enables displaying the DND (do-not-disturb) status of your mac.
Introduces a new #{dnd_status}
format to display whether DND mode is on or off.
Tested and working on MacOS (Big Sur) only.
Presently requires: brew install "vitorgalvao/tiny-scripts/calm-notifications"
Usage
Add #{dnd_status}
format string to your existing status-right
or status-left
tmux
option.
Here's the example in .tmux.conf
:
set -g status-right "#{dnd_status} | %a %h-%d %H:%M "
macOS
On macOS the above will look like this when DND is on
or this when DND is off
Configure icons
If the icons don't display well on your machine you can change them in
.tmux.conf
:
set -g @dnd_on_icon "DND"
set -g @dnd_off_icon ""
Tmux Plugin Manager (recommended)
Installation withAdd plugin to the list of TPM plugins in .tmux.conf
:
set -g @plugin 'megalithic/tmux-dnd-status'
Hit prefix + I
to fetch the plugin and source it.
#{dnd_status}
interpolation should now work.
Manual Installation
Clone the repo:
$ git clone https://github.com/megalithic/tmux-dnd-status ~/clone/path`
Add this line to the bottom of .tmux.conf
:
run-shell ~/clone/path/dnd-status.tmux
Reload TMUX environment:
$ tmux source-file ~/.tmux.conf
#{dnd_status}
interpolation should now work.
Limitations
DND status text most likely won't be instant. The duration depends on the
status-interval
Tmux option. So, it might take anywhere between 5 and 60
seconds for DND status text to change.
Set status-interval
to a low number to make this faster, example (in .tmux.conf
):
set -g status-interval 5
Also, MacOS Big Sur introduced some breaking changes to make it more challenging to set and get DND status; so we now use a nice ruby script instead.