Shows how many Claude Code sessions are waiting for input in your waybar.
- Hook triggers when Claude becomes idle β adds π to terminal title
- Waybar module counts windows with π in title
- Click to focus that session
#!/bin/bash
case "$1" in
set)
# Add π to current terminal title
CURRENT_TITLE=$(hyprctl activewindow -j | jq -r '.title')
if [[ "$CURRENT_TITLE" != *"π"* ]]; then
printf '\033]2;π %s\007' "$CURRENT_TITLE"
fi
;;
clear)
# Remove π from terminal title
CURRENT_TITLE=$(hyprctl activewindow -j | jq -r '.title')
NEW_TITLE="${CURRENT_TITLE//π /}"
printf '\033]2;%s\007' "$NEW_TITLE"
;;
check)
# Count windows with π in title
COUNT=$(hyprctl clients -j | jq -r '[.[] | select(.title | test("π"))] | length')
if [ "$COUNT" -eq 0 ]; then
echo '{"text":"σ°©","tooltip":"No Claude sessions waiting","class":"idle"}'
elif [ "$COUNT" -eq 1 ]; then
TITLE=$(hyprctl clients -j | jq -r '.[] | select(.title | test("π")) | .title' | head -1)
echo "{\"text\":\"σ°© $COUNT\",\"tooltip\":\"$TITLE\",\"class\":\"pending\"}"
else
TITLES=$(hyprctl clients -j | jq -r '.[] | select(.title | test("π")) | .title' | tr '\n' '\n')
echo "{\"text\":\"σ°© $COUNT\",\"tooltip\":\"$COUNT sessions waiting\",\"class\":\"pending\"}"
fi
;;
focus)
# Focus Claude window (or show picker if multiple)
WINDOWS=$(hyprctl clients -j | jq -r '.[] | select(.title | test("π|Claude")) | "\(.address)|\(.title)"')
WINDOW_COUNT=$(echo "$WINDOWS" | grep -c . || echo 0)
if [ "$WINDOW_COUNT" -eq 0 ]; then
notify-send "Claude" "No Claude sessions found"
elif [ "$WINDOW_COUNT" -eq 1 ]; then
ADDR=$(echo "$WINDOWS" | head -1 | cut -d'|' -f1)
hyprctl dispatch focuswindow "address:$ADDR"
else
# Multiple windows - use your preferred picker (wofi, rofi, walker, etc.)
SELECTION=$(echo "$WINDOWS" | cut -d'|' -f2 | wofi --dmenu -p "Select Claude session")
if [ -n "$SELECTION" ]; then
ADDR=$(echo "$WINDOWS" | grep "|$SELECTION$" | cut -d'|' -f1)
[ -n "$ADDR" ] && hyprctl dispatch focuswindow "address:$ADDR"
fi
fi
;;
esac{
"hooks": {
"Notification": [
{
"matcher": "idle_prompt",
"hooks": [
{
"type": "command",
"command": "~/.local/bin/claude-input-notify.sh set"
}
]
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "~/.local/bin/claude-input-notify.sh clear"
}
]
}
]
}
}{
"modules-center": ["custom/claude"],
"custom/claude": {
"exec": "~/.local/bin/claude-input-notify.sh check",
"return-type": "json",
"interval": 5,
"format": "{}",
"on-click": "~/.local/bin/claude-input-notify.sh focus"
}
}#custom-claude.pending {
color: #f9e2af;
animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}- Hyprland (uses
hyprctl) - jq
- waybar
- A dmenu-compatible launcher (wofi, rofi, walker) for the picker