feat(dmenu): add --preview flag for tab-separated label/preview pairs#984
Open
Razuer wants to merge 1 commit intovicinaehq:mainfrom
Open
feat(dmenu): add --preview flag for tab-separated label/preview pairs#984Razuer wants to merge 1 commit intovicinaehq:mainfrom
Razuer wants to merge 1 commit intovicinaehq:mainfrom
Conversation
Adds a new --preview flag to dmenu that enables tab-separated input format where each line can specify a display label and a separate preview image path: printf "Gruvbox\t/path/to/gruvbox.png" | vicinae dmenu --preview When --preview is enabled: - Input is parsed as label<TAB>preview_path - Icons are suppressed (clean labels with preview panel only) - Preview panel shows the image from the specified path This is useful for theme pickers and similar UIs where you want human-readable names with associated image previews.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a --preview flag to the dmenu CLI that enables tab-separated input format for displaying clean labels alongside preview images.
Changes:
- Introduces
DMenuEntrystruct to store label and preview path separately - Adds tab-delimited parsing when
--previewflag is enabled - Automatically suppresses icon prefixes in preview mode to avoid redundancy with preview panel
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| lib/vicinae-ipc/include/vicinae-ipc/ipc.hpp | Adds preview boolean field to DMenu Request struct |
| vicinae/src/cli/cli.cpp | Adds --preview CLI flag with appropriate help text |
| vicinae/src/ui/dmenu-view/dmenu-model.hpp | Introduces DMenuEntry struct and updates model to handle label/preview path pairs with proper hashing |
| vicinae/src/ui/dmenu-view/dmenu-view.hpp | Updates member variables to use DMenuEntry instead of raw string_view |
| vicinae/src/ui/dmenu-view/dmenu-view.cpp | Implements tab-separated parsing logic and updates all methods to use entry.label for display while using entry.quickLookPath for previews |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
--previewflag to dmenu CLI for tab-separated input format (label<TAB>preview_path)Usage
Use Case
Theme pickers and similar UIs where you want human-readable names with associated image previews, rather than raw file paths.
Example