Skip to content

Instantly share code, notes, and snippets.

@izzqz
Last active December 6, 2024 12:49
Show Gist options
  • Select an option

  • Save izzqz/1ab7d78d2afdb62fe97b602eb8631908 to your computer and use it in GitHub Desktop.

Select an option

Save izzqz/1ab7d78d2afdb62fe97b602eb8631908 to your computer and use it in GitHub Desktop.
This script parses the i3bar protocol and outputs it as a single line. It's for using i3-style bars like i3status-rust in dwm or similar window managers
#!/bin/bash
# To use this pipe i3bar to stdin
# Example i3stauts-rs | ./i3bar-parse.sh
while read line; do
echo "$line" | jq -r '.[].full_text' 2>/dev/null | tr '\n' ' ' | grep -v '^$'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment