Skip to content

hillaryychan/ulauncher-fzf

Repository files navigation

Ulauncher Fuzzy Finder

Find files and directories in Ulauncher using fzf (and fd).

ulauncher-fzf preview

Requirements

  • Ulauncher
  • Python 3.7 or higher
  • fzf
  • fd

Features

  • Fuzzy searching for files, directories or both
  • Allow hidden files to be searched
  • Follow symbolic links
  • Specify preferred number of results returned
  • Specify base directory to be searched
  • Ignore certain files and directories - you can do this by creating an ignore-file which follows the .gitignore format, then specify the path to ignore-file in the extension's settings.

Actions:

  • Click or press "Enter" to open
    • a file with its default application
    • a directory in your file manager
  • You can select your preferred action for "Alt+Enter". Actions include:
    • opening the directory in which the file is contained (default)
    • copying the file path to your clipboard

Development

You can use command runners make or just to run project-specific commands. Any make target can also be run with just. E.g., make dev or just dev

  1. Clone repository.

    git clone https://github.com/hillaryychan/ulauncher-fzf.git
  2. (Optional) Install developer dependencies.
    This is used to install dependencies for running lint and format. It will require Python 3.7 or higher and poetry.

    make setup
  3. Create a symlink to the Ulauncher extensions directory.

    make link
  4. Stop Ulauncher.

  5. Run Ulauncher and the extension.
    If don't mind having other extensions running alongside this extension, you can start Ulauncher in developer and verbose mode.

    make start

    If you would like only this extension to run in Ulauncher.

    1. Run Ulauncher with no extensions and logging enabled.

      make dev
    2. In a separate terminal, run ulauncher-fzf.
      The command to run the extension should be visible in the logging for Step 5i. It should look like this:

      VERBOSE=1 ULAUNCHER_WS_API=ws://127.0.0.1:5050/ulauncher-demo PYTHONPATH=/home/username/projects/ulauncher /usr/bin/python /home/username/.local/share/ulauncher/extensions/ulauncher-demo/main.py

Full list of targets for the command runners:

  • setup - install developer dependencies
  • lint - run code linters and formatter checks
  • format - run code formatters
  • link - create symlink to Ulauncher extensions directory
  • unlink - remove symlink created by link
  • start - run Ulauncher with logging enabled
    note: this will also run all extensions present in ~/.local/share/ulauncher/extensions/
  • dev - run Ulauncher with no extensions and logging enabled

Contributing

All contributions are welcome. Raise an issue or open a pull request.

License

This source code is licensed under the MIT license.