Skip to content

fix(asusctl): dynamically resolve D-Bus object path for Slash and XGM LED interfaces - #270

Open
scardracs wants to merge 1 commit into
OpenGamingCollective:mainfrom
scardracs:fix/slash-dbus-path
Open

fix(asusctl): dynamically resolve D-Bus object path for Slash and XGM LED interfaces#270
scardracs wants to merge 1 commit into
OpenGamingCollective:mainfrom
scardracs:fix/slash-dbus-path

Conversation

@scardracs

@scardracs scardracs commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes an unhandled D-Bus UnknownInterface: Unknown interface 'xyz.ljones.Slash' error when executing asusctl slash set or asusctl slash get.
Previously, slash_cli.rs and xgm_led_cli.rs used static proxy initialization (SlashProxyBlocking::new(&conn)), which directed D-Bus method calls to a hardcoded default path (/xyz/ljones). However, asusd exports SlashZbus dynamically under /org/asuslinux/aura/slash via D-Bus ObjectManager. This caused asusctl slash commands to fail even on supported hardware models with Slash lighting (e.g. ROG Zephyrus G14 GA403), whereas rog-control-center succeeded because it resolved the object path dynamically using find_iface_async.

Summary of Changes:

  • Added find_iface_blocking<T>(iface_name: &str) helper function to rog-dbus (synchronous counterpart to find_iface_async).
  • Updated slash_cli.rs and xgm_led_cli.rs to resolve proxy object paths dynamically via find_iface_blocking.
  • Removed redundant local find_iface helper in asusctl/src/main.rs.
  • Replaced internal library println! logs with structured log::warn!.
  • Added deduplication and sorting to list_iface_blocking().
    Fixes N/A

Tested Hardware & Environment N/A

Verification and testing:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My code follows the style guidelines of this project (cargo fmt --all -- --check)
  • My changes generate no new warnings (cargo clippy --all -- -D warnings/cargo check --all-targets)
  • New and existing unit tests pass locally with my changes (cargo test --all)
  • Cranky with 0 warning (cargo cranky)

Closes: #269

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Improvements
    • Improved device and feature detection across supported hardware interfaces.
    • Slash and XGM LED commands now apply consistently when multiple matching devices are connected.
    • Interface results are sorted, deduplicated, and reported more consistently.
    • Improved handling of multiple-device configurations and connection scenarios.
    • Enhanced reliability for Aura, backlight, Anime, and Armoury Crate-related controls.
    • Improved consistency when discovering and controlling supported hardware features.

Walkthrough

The change centralizes blocking D-Bus interface discovery in rog-dbus. Main, Slash, and XG LED CLI operations now use the shared helper and process all matching interfaces.

Changes

D-Bus discovery migration

Layer / File(s) Summary
Shared blocking discovery helper
rog-dbus/Cargo.toml, rog-dbus/src/lib.rs
rog-dbus adds find_iface_blocking, sorts and deduplicates interface results, and logs multiple matches.
Main CLI proxy migration
asusctl/src/main.rs
Main CLI operations use the shared helper for Aura, Backlight, Anime, ScsiAura, and AsusArmoury interfaces.
Slash and XG LED migration
asusctl/src/slash_cli.rs, asusctl/src/xgm_led_cli.rs
Slash and XG LED operations discover all matching interfaces and apply actions to each proxy.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: asusctl, rog-slash, xgmled, fix

Suggested reviewers: neroreflex

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the dynamic D-Bus object path fix for Slash and XGM LED interfaces.
Description check ✅ Passed The description explains the issue, summarizes the changes, identifies testing status, and links the related issue.

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

@coderabbitai coderabbitai Bot added asusctl CLI Tool fix Fix a bug or an issue rog-slash Slash LED Bar xgmled XG Mobile LED labels Aug 4, 2026
@Ariel-Inacio

Copy link
Copy Markdown

This change works, it is now possible to enable and disable the slash bar via asusctl on the G14 (GA403UI) without errors.

20260804_185532.mp4

@scardracs

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@scardracs
scardracs force-pushed the fix/slash-dbus-path branch from 105ebbd to 726f39d Compare August 5, 2026 10:33
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

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

Labels

asusctl CLI Tool fix Fix a bug or an issue rog-slash Slash LED Bar xgmled XG Mobile LED

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Slash Bar DBus error on asusctl

2 participants