Skip to content

Conversation

@zeerayne
Copy link
Contributor

@zeerayne zeerayne commented Jan 15, 2026

Pull Request

Description

Feature

This PR is relateted to #1551

Adds simple waybar module which opens rofi apps menu with a click
image

Also added support for passing extra args to rofi via hyde-shell rofilaunch.
The idea was to use -click-to-exit option to be able to control rofi menu without keyboard fully.

But at the moment -click-to-exit is unsupported on wayland davatorium/rofi#2158

Fixes

Change styles for tooltip & menu decoration because in certain (almist random) cases there were no border for popups. Changed styles looks stable and do not show this random border miss.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (non-breaking change; modified files are limited to the documentations)
  • Technical debt (a code change that does not fix a bug or add a feature but makes something clearer for devs)
  • Other (provide details below)

Checklist

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My commit message follows the commit guidelines.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added a changelog entry.
  • I have added necessary comments/documentation to my code.
  • I have added tests to cover my changes.
  • I have tested my code locally and it works as expected.
  • All new and existing tests passed.

Summary by CodeRabbit

  • New Features

    • Added a custom application launcher to Waybar with a rocket icon and interactive tooltip.
  • Refactor

    • Improved launcher argument handling for more reliable click/launch behavior and proper forwarding of extra options.
  • Style

    • Unified tooltip and popup border styling for a cleaner, consistent appearance.

✏️ Tip: You can customize this high-level summary in your review settings.

Added support for passing extra args to rofi.
The idea was to use `-click-to-exit` option to be able to control app
menu without keyboard fully.

But at the moment `-click-to-exit` is unsupported on wayland
davatorium/rofi#2158
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 15, 2026

📝 Walkthrough

Walkthrough

Updates rofilaunch.sh to consume one positional argument per action branch and pass remaining args to rofi; consolidates border CSS properties into a shorthand in Waybar styles; and adds a new Waybar custom application launcher module configuration.

Changes

Cohort / File(s) Summary
Shell Script Argument Handling
Configs/.local/lib/hyde/rofilaunch.sh
Adds shift after each action case branch (drun, window, filebrowser, run) so one positional parameter is consumed per branch, and appends remaining arguments with rofi_args+=("$@").
CSS Border Consolidation
Configs/.local/share/waybar/styles/defaults.css
Replaces border-width and border-color with border: 0.1em solid @main-fg`` shorthand in tooltip and window.popup decoration rules.
Waybar Module Configuration
Configs/.local/share/waybar/modules/custom-app-launcher.jsonc
Adds custom/app-launcher Waybar module: format: "", tooltip enabled with tooltip-format: " Application Launcher", rotate: 0, and on-click: "hyde-shell rofilaunch d -click-to-exit".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I nudge a shift, the args align,
Borders snuggle in one tidy line,
A rocket waits on Waybar's rim,
Click and watch the launcher brim,
Happy hops — the changes sing! 🚀

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately reflects the main change: adding a new Waybar module for an application launcher.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings


📜 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 3208d23 and 7032544.

📒 Files selected for processing (1)
  • Configs/.local/lib/hyde/rofilaunch.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • Configs/.local/lib/hyde/rofilaunch.sh

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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
Contributor

@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: 1

🤖 Fix all issues with AI agents
In `@Configs/.local/lib/hyde/rofilaunch.sh`:
- Around line 65-66: The array append currently uses unquoted positional
parameters (rofi_args+=($@)), which causes word splitting; change the append so
each original argument is preserved as its own array element by using the quoted
form of the positional parameters when appending to rofi_args (i.e., append
using the quoted $@ form) so arguments with spaces like -theme "My Theme" are
not split.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f124631 and 58322e7.

📒 Files selected for processing (3)
  • Configs/.local/lib/hyde/rofilaunch.sh
  • Configs/.local/share/waybar/modules/custom-applauncher.jsonc
  • Configs/.local/share/waybar/styles/defaults.css
🧰 Additional context used
🧬 Code graph analysis (1)
Configs/.local/share/waybar/modules/custom-applauncher.jsonc (1)
Configs/.local/lib/hyde/waybar.py (3)
  • update_icon_size (833-872)
  • generate_includes (1193-1225)
  • update_config (1228-1231)
🪛 Biome (2.1.2)
Configs/.local/share/waybar/styles/defaults.css

[error] 242-242: Unexpected value or character.

Expected one of:

(parse)


[error] 246-246: Unexpected value or character.

Expected one of:

(parse)


[error] 244-245: Unknown type selector is not allowed.

See MDN web docs for more details.
Consider replacing the unknown type selector with valid one.

(lint/correctness/noUnknownTypeSelector)


[error] 245-245: Unknown type selector is not allowed.

See MDN web docs for more details.
Consider replacing the unknown type selector with valid one.

(lint/correctness/noUnknownTypeSelector)

🪛 Shellcheck (0.11.0)
Configs/.local/lib/hyde/rofilaunch.sh

[warning] 65-65: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.

(SC2206)

🔇 Additional comments (4)
Configs/.local/share/waybar/styles/defaults.css (1)

238-247: LGTM! Border consolidation improves maintainability.

The shorthand border property correctly consolidates the previous separate border-width and border-color declarations. This addresses the PR objective of fixing intermittent missing borders.

Note: The static analysis warnings about "unexpected value" and "unknown type selector" are false positives—Biome is a web CSS linter and doesn't recognize GTK CSS variable syntax (@main-fg) or GTK-specific selectors like window.popup decoration.

Configs/.local/share/waybar/modules/custom-applauncher.jsonc (1)

1-9: Module configuration looks good.

The structure is valid and integrates well with the existing Waybar module discovery system. The hyde-shell rofilaunch d -click-to-exit invocation aligns with the updated argument handling in rofilaunch.sh.

One consideration: since -click-to-exit is unsupported on Wayland (as noted in the PR description), users on Wayland won't get the expected click-to-dismiss behavior. This is acceptable given the upstream limitation, but you might consider documenting this in the tooltip or module comments for discoverability.

Configs/.local/lib/hyde/rofilaunch.sh (2)

55-62: Verify intended behavior for the default case shift.

When the script is called without a recognized mode (e.g., rofilaunch -click-to-exit instead of rofilaunch d -click-to-exit), the shift on line 61 will consume the first argument, causing it to be lost before appending to rofi_args on line 65.

If the expectation is that users must always specify a mode explicitly, this is fine. Otherwise, consider guarding the shift:

Optional: conditional shift for default case
     *)
         r_mode="drun"
         ROFI_LAUNCH_DRUN_STYLE="${ROFI_LAUNCH_DRUN_STYLE:-$ROFI_LAUNCH_STYLE}"
         rofi_args+=("${ROFI_LAUNCH_DRUN_ARGS[@]:-}")
         rofi_args+=("-run-command" "app2unit.sh  --fuzzel-compat -- {cmd}")
         rofi_config="${ROFI_LAUNCH_DRUN_STYLE:-$rofi_config}"
-        shift
+        [[ -n "$1" ]] && shift
         ;;

20-46: LGTM! Shift operations correctly consume mode arguments.

The shift additions after each case enable passing extra arguments (like -click-to-exit) through to rofi, which is the intended behavior for the new Waybar module.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Copy link
Contributor

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Configs/.local/lib/hyde/rofilaunch.sh (1)

55-62: Bug: shift in default case discards arguments that should be passed through.

The default case handles two scenarios:

  1. No arguments provided (run drun mode)
  2. First argument is not a recognized mode selector

In scenario 2, the user's first argument (e.g., -click-to-exit) is consumed by shift and lost. For example, rofilaunch.sh -click-to-exit will drop the flag entirely.

Proposed fix

Remove the shift from the default case since no mode argument was consumed:

     *)
         r_mode="drun"
         ROFI_LAUNCH_DRUN_STYLE="${ROFI_LAUNCH_DRUN_STYLE:-$ROFI_LAUNCH_STYLE}"
         rofi_args+=("${ROFI_LAUNCH_DRUN_ARGS[@]:-}")
         rofi_args+=("-run-command" "app2unit.sh  --fuzzel-compat -- {cmd}")
         rofi_config="${ROFI_LAUNCH_DRUN_STYLE:-$rofi_config}"
-        shift
         ;;
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 58322e7 and 69e069e.

📒 Files selected for processing (1)
  • Configs/.local/lib/hyde/rofilaunch.sh
🔇 Additional comments (2)
Configs/.local/lib/hyde/rofilaunch.sh (2)

20-46: LGTM!

The shift additions in the recognized mode cases correctly consume the mode selector argument, allowing subsequent positional parameters to be forwarded to rofi.


65-66: LGTM!

The quoted "$@" correctly preserves argument boundaries, addressing the previous review feedback.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@kRHYME7
Copy link
Contributor

kRHYME7 commented Jan 15, 2026

But at the moment -click-to-exit is unsupported on wayland davatorium/rofi#2158

But we are using this version of rofi now. the Wayland fork has already been merged. Will it break if unsupported?

@zeerayne
Copy link
Contributor Author

Nope, it does not break anything. Option just dont work silently. This is why I decided to leave it (hopes it will work some day)

@kRHYME7
Copy link
Contributor

kRHYME7 commented Jan 16, 2026

can you name it 'app-launcher'?

Also maybe check #1557 (review) .

@zeerayne
Copy link
Contributor Author

@kRHYME7 renamed, review comment fixed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants