Skip to content

Instantly share code, notes, and snippets.

@m-rey
Created April 30, 2020 14:03
Show Gist options
  • Save m-rey/bbfbc90cdcea21a11b7932203bd6be78 to your computer and use it in GitHub Desktop.
Save m-rey/bbfbc90cdcea21a11b7932203bd6be78 to your computer and use it in GitHub Desktop.
Waybar module to display how many users are connected to a minecraft server. Displays usernames on left click and opens the TLauncher Minecraft client flatpak on right click.
"custom/minecraft": {
"format": "⬢ {}",
"interval": 10,
"exec": "printf '\\x06\\x00\\x00\\x00\\x00\\x00\\x01\\x01\\x00' | nc -N $SERVER_IP $SERVER_PORT | tr -cd '[:print:]' | jq -r '.players.online, .players.max'| xargs printf '%d/%d'",
"on-click": "printf '\\x06\\x00\\x00\\x00\\x00\\x00\\x01\\x01\\x00' | nc -N $SERVER_IP $SERVER_PORT | tr -cd '[:print:]' | jq -r '.players.sample[] | .name' | xargs -0 notify-send 'online users'",
"on-click-right": "flatpak run org.tlauncher.TLauncher"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment