Skip to content

feat(dmenu): add --preview flag for tab-separated label/preview pairs#984

Open
Razuer wants to merge 1 commit intovicinaehq:mainfrom
Razuer:feat/dmenu-preview-flag
Open

feat(dmenu): add --preview flag for tab-separated label/preview pairs#984
Razuer wants to merge 1 commit intovicinaehq:mainfrom
Razuer:feat/dmenu-preview-flag

Conversation

@Razuer
Copy link
Contributor

@Razuer Razuer commented Jan 20, 2026

Summary

  • Adds --preview flag to dmenu CLI for tab-separated input format (label<TAB>preview_path)
  • When enabled, displays clean labels while showing preview images from specified paths
  • Suppresses icon prefixes in preview mode to avoid redundancy with the preview panel

Usage

# Tab-separated: label<TAB>absolute_preview_path
printf "Gruvbox\t/path/to/gruvbox.png\nDracula\t/path/to/dracula.png" | vicinae dmenu --preview

Use Case

Theme pickers and similar UIs where you want human-readable names with associated image previews, rather than raw file paths.

Example

image

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.
Copilot AI review requested due to automatic review settings January 20, 2026 21:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 DMenuEntry struct to store label and preview path separately
  • Adds tab-delimited parsing when --preview flag 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.

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