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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file pydymenu-0.5.2.tar.gz.

File metadata

  • Download URL: pydymenu-0.5.2.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for pydymenu-0.5.2.tar.gz
Algorithm Hash digest
SHA256 4c0afc0c3a0a959bb60d2024f67e59db0206df49b9eb66702040a97eba022cbe
MD5 e71e8fde18b57e843eaf052b66d2d8ab
BLAKE2b-256 1922c8f8dba147e81d1187cfd7ee0a5faedf65b668feb963e00e4924ad653ebe

See more details on using hashes here.

File details

Details for the file pydymenu-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: pydymenu-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for pydymenu-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 86592c1221a01453a55e88376d5d6b3e0013c3e67c6484f31f3b9351de711a30
MD5 d541a9a94c2ba80816b22926fc123047
BLAKE2b-256 fec7f61dc38a124c0b0f191159bea709eddcbebd2b3961171db5352517d4aedf

See more details on using hashes here.

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