Skip to main content

A pythonic wrapper interface for fzf, dmenu, and rofi.

Project description

pydymenu: A Pythonic interface for fzf and rofi

A single package to serve all your dynamic menu-ing needs with a simple Pythonic interface.

Installation

Dependencies

sudo apt install fzf rofi -y

From PyPi

pip3 install --user pydymenu

Usage

from pydymenu import fzf, rofi

people = ["Joe", "Sam", "Daniel", "Bret", "Jordan", "Eric", "Lex"]

# fzf
talker = fzf(people, prompt="Pick a podcaster: ", preview="figlet {}")
if talker:
    return talker[0]

# rofi
gui_select = rofi(people, prompt="Pick a podcaster: ", multi=True)
if gui_select:
    return gui_select[0]

pydymenu.MENU(items: Iterable[str], **options) -> Optional[List[str]]

Options

prompt: str : The prompt text shown at the selection (default: >)

multi: bool : Whether or not to allow multiple selections. (default: multi=False)

case_sensitive: bool : Whether or not to use case sensitive search (default: case_sensitive=False)

preview: str (fzf only) : Command that will be run on each entry and displayed as it's preview when using the fuzzy finder.

Project Status

Working support for the most common fzf and rofi use cases. Currently expanding functionality for those two programs then going to move onto adding dmenu support.

I'm trying to keep this package as a pretty simple drop-in replacement for iterfzf. Biggest design changes are:

  • fzf automatically sorts results based on match quality.
  • Selections always return lists of strings. When multi=False returns a list of length 1.

Roadmap:

  • Support for dmenu systems

Source of Truth

This project is available on GitHub and GitLab. Each push to master automatically goes to both so choose whichever platform you prefer. All releases are uploaded to PyPi

Big thanks to fzf and Rofi developers for making the utilities this tool relies upon.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydymenu-0.5.2.tar.gz (20.7 kB view hashes)

Uploaded Source

Built Distribution

pydymenu-0.5.2-py3-none-any.whl (21.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page