Skip to content

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

Merged
Ghoul4500 merged 1 commit into
OpenGamingCollective:mainfrom
scardracs:fix/slash-dbus-path
Aug 6, 2026
Merged

fix(asusctl): dynamically resolve D-Bus object path for Slash and XGM LED interfaces#270
Ghoul4500 merged 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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a3427512-73b1-4d58-8273-4e59f1c7a6d8

📥 Commits

Reviewing files that changed from the base of the PR and between 2aa8ab2 and 2e856f6.

📒 Files selected for processing (5)
  • asusctl/src/main.rs
  • asusctl/src/slash_cli.rs
  • asusctl/src/xgm_led_cli.rs
  • rog-dbus/Cargo.toml
  • rog-dbus/src/lib.rs
📜 Recent review details
🔇 Additional comments (17)
rog-dbus/Cargo.toml (1)

21-21: LGTM!

rog-dbus/src/lib.rs (3)

26-27: LGTM!


78-78: LGTM!


98-131: LGTM!

asusctl/src/main.rs (9)

16-16: LGTM!


224-224: LGTM!


251-251: LGTM!

Also applies to: 265-265


284-284: LGTM!


339-339: LGTM!


522-522: LGTM!


586-586: LGTM!

Also applies to: 602-602


643-643: LGTM!

Also applies to: 700-700


996-998: LGTM!

Also applies to: 1007-1007, 1023-1023

asusctl/src/slash_cli.rs (3)

2-2: LGTM!


82-119: LGTM!


122-147: LGTM!

asusctl/src/xgm_led_cli.rs (1)

2-21: LGTM!


📝 Walkthrough

Summary by CodeRabbit

  • Improvements
    • Improved detection and control of supported hardware features.
    • Slash and XGM LED commands now apply consistently across multiple connected devices.
    • Aura, backlight, Anime, and Armoury Crate controls are more reliable.
    • Device interfaces are now identified consistently, with duplicate results removed.
    • Improved handling and reporting for multiple-device configurations.
    • Enhanced reliability when connecting to and managing supported hardware.

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
Title check ✅ Passed The title clearly identifies the fix for dynamic D-Bus object-path resolution in Slash and XGM LED interfaces.
Description check ✅ Passed The description explains the bug, summarizes the implementation, references issue #269, and reports verification results.
Linked Issues check ✅ Passed The changes address issue #269 by dynamically resolving Slash interfaces and preventing the reported UnknownInterface error.
Out of Scope Changes check ✅ Passed The changes remain within the stated objectives, including shared interface discovery, logging, deduplication, and CLI updates.

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.

@scardracs
scardracs force-pushed the fix/slash-dbus-path branch from 726f39d to 2e856f6 Compare August 6, 2026 09:08
@coderabbitai

coderabbitai Bot commented Aug 6, 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.

@Ghoul4500 Ghoul4500 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thank you for the contribution

@Ghoul4500
Ghoul4500 merged commit c47ccea into OpenGamingCollective:main Aug 6, 2026
1 check passed
@scardracs
scardracs deleted the fix/slash-dbus-path branch August 6, 2026 17:37
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

3 participants