Skip to content

haddystuff/ulauncher-fast-open

Repository files navigation

Ulauncher Fast Open

License: MIT

Simple and customizable Ulauncher extension that quickly searches and opens files/directories with your app of choice.

About the project

This project aims to provide a simple and highly customizable alternative to an existing Ulauncher file search extensions such as File Search, Fuzzy finder, Vscode project opener. It combines their features with some better customizability.

Demo

demo

Installation

  1. Install Ulauncher.
  2. Install fzf
  3. Install fd
    Note that for Ubuntu the binary is called fdfind, so don't forget to add a link to fd by executing command ln -s $(which fdfind) ~/.local/bin/fd
  4. Install the extension using Ulauncher extension manager:
    • Open Ulauncher preferences (Gear icon).
    • Go to Extensions tab.
    • Click on "Add extension" button.
    • Paste the following URL in the "Extension URL" field: git@github.com:haddystuff/ulauncher-fast-open.git
    • Click "Add" button.
  5. (Optional) Configure the extension to your liking (see Configuration and Customization section).

Usage

  1. Open Ulauncher and type fo followed by a space.
  2. Type your search query to find files or directories.
  3. Select the desired file or directory from the list.
  4. Press Enter to open it with a command specified in configuration.

Configuration and Customization

  • Extension keyword - keyword to trigger the extension (default: fo).
  • on Enter command - command to run when Enter is pressed. Use %s as a placeholder for the selected file/directory path (default: code %s).
  • on Alt+Enter command - command to run when Alt+Enter is pressed. Use %s as a placeholder for the selected file/directory path (default: xdg-open %s).
  • fd arguments - additional arguments to pass to fd command. Flag --color never and the search pattern (.) are already included. (default: --type f --type d --follow --exclude .git).
  • fzf arguments - additional arguments to pass to fzf command. Flag --filter is already included. (default: empty).
  • base_dir - base directory to start searching from. (default: ~).
  • result_limit - maximum number of results to show (default: 15).

Customization Examples

  • Search projects directory with depth of 2:

    • fd arguments: --type d -d 2 --follow --exclude .git
    • fzf arguments: ``
    • on Enter command: code %s
    • base_dir: ~/projects
  • Search only python files in home directory:

    • fd arguments: --type f -e py --follow --exclude .git
    • fzf arguments: ``
    • on Enter command: code %s
    • base_dir: ~

Development

Prerequisites

  • uv
  • Taskfile

Running Locally

  1. Run init task that will install all the dependencies, set up pre-commit hooks and create a symlink in ulauncher extensions directory:

    task init
  2. Start the extension in Ulauncher in dev mode:

    task start
  3. Make changes to the code and see them reflected in Ulauncher immediately.

No taskfile

If you don't have Taskfile installed or prefer not to use it, you can run the commands from Taskfile.yaml manually.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Acknowledgements

Best regards to the authors of Ulauncher and these awesome Ulauncher extensions that inspired this project:

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Simple and customizable Ulauncher extension that quickly searches and opens files/directories with your app of choice.

Topics

Resources

License

Stars

Watchers

Forks

Languages