Skip to content

Conversation

@luftaquila
Copy link
Contributor

@luftaquila luftaquila commented Dec 17, 2025

I've found out that the documentation for the network-public-ip plugin was missing.

This PR adds the docs of it, and add a missing space between the label and the IP value of it's output.

Thank you!

@coderabbitai
Copy link

coderabbitai bot commented Dec 17, 2025

📝 Walkthrough

Walkthrough

Adds documentation for a new network-public-ip widget and changes the network-public-ip script to default its label to "IP" and emit the label and IP separated by a space.

Changes

Cohort / File(s) Summary
Documentation updates
docs/CONFIG.md
Added network-public-ip entry under the network group and updated the table of contents; included description and a Nerdfont label example.
Script label retrieval
scripts/network-public-ip.sh
Changed label retrieval to read a tmux option into a variable with default "IP" and output the label and IP separated by a space (emits label ip).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify scripts/network-public-ip.sh correctly reads the tmux option default and formats output as label ip.
  • Confirm docs/CONFIG.md TOC link and example reflect the script's output format.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the primary change: adding documentation for the network-public-ip plugin, which is the main objective of the PR.
Description check ✅ Passed The description is related to the changeset, mentioning both the documentation addition and the spacing fix in the plugin output.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 412cd20 and 2c9a221.

📒 Files selected for processing (1)
  • docs/CONFIG.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/CONFIG.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
docs/CONFIG.md (1)

649-658: Documentation looks good; consider adding trailing space for style consistency.

The documentation is clear and follows the established plugin pattern. The functionality is correct as-is.

For consistency with other plugin examples in this file (e.g., battery-label at line 205, network-offline-label at line 633), consider adding a trailing space in the example:

-set -g @dracula-network-public-ip-label "󰖟"
+set -g @dracula-network-public-ip-label "󰖟 "

Both approaches work since the script adds a space programmatically; this is purely for documentation style consistency.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2b762b3 and 7f46e71.

📒 Files selected for processing (2)
  • docs/CONFIG.md (2 hunks)
  • scripts/network-public-ip.sh (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
scripts/network-public-ip.sh (1)
scripts/utils.sh (1)
  • get_tmux_option (3-12)
🔇 Additional comments (2)
docs/CONFIG.md (1)

28-28: LGTM!

The TOC entry is correctly positioned alphabetically and follows the established format.

scripts/network-public-ip.sh (1)

22-23: LGTM!

The implementation correctly:

  • Reads the label option using get_tmux_option with a sensible default of "IP"
  • Adds the missing space between the label and IP value in the output
  • Follows the established pattern used by other plugins in this repository

@luftaquila luftaquila changed the title Add documentation for network-public-info plugin Add documentation for network-public-ip plugin Dec 17, 2025
@luftaquila luftaquila force-pushed the doc/network-public-ip branch from 7f46e71 to 412cd20 Compare December 17, 2025 02:25
@Theoreticallyhugo
Copy link
Collaborator

Thank you very much for your contribution!
I will gladly merge the docs, but the lack of a space is actually intentional, as it is supposed to be up to the users config how much white space there is.

Co-authored-by: Hugo/ Theo Meinhof <me@theoreticallyhugo.com>

echo "$(get_tmux_option "@dracula-network-public-ip-label" "")$ip" > "${DATAFILE}"
network_public_ip_label=$(get_tmux_option "@dracula-network-public-ip-label" "IP")
echo "$network_public_ip_label $ip" > "${DATAFILE}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I didn't know that. I refer to some plugins I'm using such as uptime and cpu-arch and there was space between the label and text, so I added it.

So it should be like this, right?

Suggested change
echo "$network_public_ip_label $ip" > "${DATAFILE}"
echo "$network_public_ip_label$ip" > "${DATAFILE}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants