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>/.
Waybar (Sway / Hyprland / wlroots)
Section titled “Waybar (Sway / Hyprland / wlroots)”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; }.
Polybar (i3 / bspwm / X11 bars)
Section titled “Polybar (i3 / bspwm / X11 bars)”Add to ~/.config/polybar/config.ini and put wordcount in
your bar’s modules-right:
[module/wordcount]type = custom/scriptexec = $HOME/.local/bin/wordcount panelinterval = 30click-left = $HOME/.local/bin/wordcount togglei3blocks (i3bar)
Section titled “i3blocks (i3bar)”Copy the helper script and add the block to
~/.config/i3blocks/config:
cp widgets/i3blocks/wordcount-i3blocks.sh ~/.local/bin/chmod +x ~/.local/bin/wordcount-i3blocks.sh[wordcount]command=$HOME/.local/bin/wordcount-i3blocks.shinterval=30The helper prints wordcount panel output and toggles
pause/resume on click (i3blocks sets BLOCK_BUTTON on clicks).
Conky (desktop overlay, any DE/WM)
Section titled “Conky (desktop overlay, any DE/WM)”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.
- Right-click panel → Add to Panel → Command (the “Command”
applet from
mate-applets; install it if missing). - Command:
/home/YOU/.local/bin/wordcount panel - Interval: 30 seconds.
- Right-click panel → Add Widgets → Custom Command.
- Command:
/home/YOU/.local/bin/wordcount panel - Repeat every: 30 seconds.
Full stats and charts
Section titled “Full stats and charts”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.