feat!: replace indicator-sysmonitor with a self-owned tray indicator and IP changelog - #7
Merged
Merged
Conversation
GNOME Shell's AppIndicator extension only refreshes the panel label on a custom D-Bus signal it doesn't always receive, so the flag icon can show with no IP/country text next to it even though the label is set correctly.
… IP history indicator-sysmonitor's dropdown menu is hardcoded with no plugin hook to add items, so there was no way to surface IP-change history from its tray icon. locindicator.py now owns the AppIndicator3 tray icon directly, still driven by get-location.sh, and adds an "IP History" menu entry backed by iphistory.py, which logs each noticed IP change (capped at the last 100) to ~/.local/share/locindicator/ip-history.log.
The tray panel label sometimes fails to render next to the icon (see README's known-issues section on the GNOME Shell appindicator extension bug), leaving no visible IP. Mirror the same status text into a disabled menu entry at the top of the dropdown, updated every tick, so the current IP/country is always visible on click regardless of that rendering bug.
…ndow A separate window was an extra click and pulled focus away from the tray; showing the last entries directly in the dropdown, right under the current IP, keeps everything visible in one click. Rows are inserted/removed in place ahead of a marker separator so an open dropdown doesn't need the whole menu rebuilt.
…rmat Each history row now reads "<country>, IP:<address> <timestamp>" instead of bare timestamp/IP, matching the status line's format and putting the IP first the way the current-IP entry already reads. A disabled "IP changelog" header now separates it from the current-IP line above. Requires iphistory to record country_code alongside each entry; older two-column log lines (no country_code) still parse fine and fall back to a bare "IP:<address>" label.
A separate disabled status line duplicated the top changelog row now that entries carry country + IP in the same format. Drop it and mark the newest changelog entry "(current)" instead, so the current IP is still visible from the dropdown without a redundant line above the changelog.
Pango markup (bold) on menu item labels doesn't survive the dbusmenu/ AppIndicator3 export to the desktop shell -- confirmed by inspecting the exported D-Bus property directly, it comes back as plain rendered text with no markup tags. Use a leading "->" marker on the current entry instead, which is a real visual distinction plain text can carry. Also drop the ISO8601 "T" separator and put time before date, per feedback.
An absolute date/time required mental math to see how stale an entry was. Show "5m ago"/"3h ago"/"2d ago" instead, computed from the stored ISO8601 timestamp. Since this needs to keep counting up, the changelog now rebuilds every tick rather than only when the IP changes.
Switches from "<country>, IP:<address> <time ago>" to a plain comma-separated "<address>, <country>, <time ago> [(current)]", per feedback. Country is omitted when unavailable.
The "(current)" suffix already marks it; the arrow was redundant.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
indicator-sysmonitordependency withlocindicator.py, a self-ownedAppIndicator3/AyatanaAppIndicator3tray process.install.shno longer clones/builds anything from source;configure_indicator.pyis removed.iphistory.py) showing recent IP changes as<address>, <country>, <time ago> [(current)], capped at the last 100 entries on disk / last 10 shown in the menu.bootstrap.sh/uninstall.shupdated for the new process and autostart entry; harmless cleanup of the oldindicator-sysmonitorartifacts is kept for anyone upgrading.BREAKING CHANGE:
indicator-sysmonitoris no longer installed or driven by this project. Anyone with an existing install should re-rununinstall.sh(from the previous version) before installing this one, so the old autostart entry, binary, and settings file are cleaned up.Test plan
pylint $(git ls-files '*.py')— 10.00/10busctlStatusNotifierItem/dbusmenu inspection): tray icon registers, label/icon update every 15s, dropdown renders the changelog with correct formatting