Skip to content

Waybar, Polybar, i3blocks, Conky, MATE/LXQt

Every bar that can run a command on an interval can show your count: they all run wordcount panel every 30s and use wordcount toggle as the click action. Ready-to-merge snippets live in the repo under widgets/<name>/.

Add this module to ~/.config/waybar/config.jsonc and place "custom/wordcount" in modules-right:

"custom/wordcount": {
"exec": "$HOME/.local/bin/wordcount panel",
"interval": 30,
"tooltip": true,
"tooltip-format": "Keyount — click to pause/resume",
"on-click": "$HOME/.local/bin/wordcount toggle"
}

Panel shows ⌨ 2,104 words. Click toggles pause/resume. Optional styling: #custom-wordcount { padding: 0 8px; }.

Add to ~/.config/polybar/config.ini and put wordcount in your bar’s modules-right:

[module/wordcount]
type = custom/script
exec = $HOME/.local/bin/wordcount panel
interval = 30
click-left = $HOME/.local/bin/wordcount toggle

Copy the helper script and add the block to ~/.config/i3blocks/config:

Terminal window
cp widgets/i3blocks/wordcount-i3blocks.sh ~/.local/bin/
chmod +x ~/.local/bin/wordcount-i3blocks.sh
[wordcount]
command=$HOME/.local/bin/wordcount-i3blocks.sh
interval=30

The helper prints wordcount panel output and toggles pause/resume on click (i3blocks sets BLOCK_BUTTON on clicks).

Add to your conky.text section:

${execi 30 $HOME/.local/bin/wordcount panel}

A fuller snippet with today’s stats is in widgets/conky/wordcount.conkyrc in the repo.

  1. Right-click panel → Add to Panel → Command (the “Command” applet from mate-applets; install it if missing).
  2. Command: /home/YOU/.local/bin/wordcount panel
  3. Interval: 30 seconds.
  1. Right-click panel → Add Widgets → Custom Command.
  2. Command: /home/YOU/.local/bin/wordcount panel
  3. Repeat every: 30 seconds.

These snippets are text-only. For full stats use wordcount today; for charts use wordcount report (HTML with hourly + 14-day bars). Pause/resume anywhere with wordcount pause / resume / toggle — bind toggle to a keyboard shortcut if your bar has no click action.