Home

Awesome

FunkyShellSearch (fss) ♫♪♪♫♪♪

FSS Preview

FunkyShellSearch (fss) is designed to make your command-line search experience more user-friendly. It integrates powerful find and grep utilities like fd, ag and pdfgrep with the intuitive fzf fuzzy finder. The goal is to optimize the workflow by offering improved file preview capabilities and faciliating direct actions to specific file types, all configurable through a configuration file.

As an ongoing project, FunkyShellSearch will continue to evolve with additional scripts, features, and documentation, further enriching the file searching and handling capabilities within the shell environment.

Stay tuned for updates!

Table of Contents

Key Features

Dependencies

The functionalities of fss scripts depend on several external tools. Below is the list of dependencies, based on the standard configuration:

Basic Search Tools

Additional Utilities and Tools

Note: Some of these dependencies are based on the default configuration of the scripts and might change if you modify the fss.conf configuration file. Adjust the dependencies accordingly based on your custom configuration.

Installation

Manual Installation

  1. Clone the Repository

Clone the fss repository from GitHub. You can do this using either HTTPS or SSH. Choose the method that suits your setup:

  1. Make the Scripts Executable

Ensure the scripts in the tools directory are executable.

chmod +x /path/to/fss/tools/*

Don't forget to replace /path/to/fss with the actual path.

  1. Add the Scripts to Your PATH

Set the FSS_ROOT_DIR environment variable to the path of the cloned fss repository. This allows the scripts to correctle source configurations and libraries.

export FSS_ROOT_DIR="$HOME/path/to/fss"

Include the fss tools directory in your PATH for convenient access to the scripts:

export PATH="$FSS_ROOT_DIR/tools:$PATH"

Note: Don't forget to replace /path/to/fss with the actual path to the fss project.

To make these changes permanent, append the above export commands to your shell's configuration file (such as ~/.bashrc for Bash or ~/.zshrc for Zsh).

Apply the changes by reloading your shell configuration:

source ~/.bashrc    # For Bash
source ~/.zshrc     # For Zsh

Using the Setup Script

For a quicker setup on Debian-based systems, you can use an automated setup script to install all necessary dependencies, making the scripts executable, copying the default configuration file and updating the shell configuration automatically.

Warning:

  1. Clone the repository as described in the "Manual Installation" above.

  2. Navigate to the setup directory, make the script executable and run it:

cd fss/setup && chmod +x setup_deb.sh && ./setup_deb.sh
  1. Reload your shell configuration:
source ~/.bashrc    # For Bash
source ~/.zshrc     # For Zsh

Configuration

The fss project comes equipped with a default configuration file, fss.conf, which is sources automatically by the project's scripts. This default configuration sets up the essential parameters for the tool's operation.

To personalize the configs according to your needs follow these steps:

  1. Copy the default configuration file into your own .config/fss directory. This allows you to modify settings without affecting the original configuration:

    mkdir -p ~/.config/fss
    cp /path/to/fss/config/fss.conf ~/.config/fss/fss.conf
    

    Note: Replace /path/to/fss with the actual path to the fss project.

  2. To edit the custom configuration open the copied fss.conf file in your preferred text editor:

    nvim ~/.config/fss/fss.conf
    
  3. Within the fss.conf file you have now the freedom to specify settings which fit your workflow.

Fss will prioritize the configuration file located at ~/.config/fss/fss.conf if it is present.

Usage

Tools

Each script can be run directly from the command line. For instance, to search for music files containing the word "funk", you would run:

fmusic "funk"

Important Notes:

Distinction Between Find, Grep and Fuzzy Searches:

The tools are intuitively categorized based on their primary search functionality.

Library Integration

The libraries can be easily integrated into custom shell scripts. Utilize the FSS_ROOT_DIR variable for sourcing libraries and constructing custom commands. The functions provided in these libraries allow you to add various options, patterns and paths. Additionally they eneble the execution of tailored search commands.

For example, to create a case-insensitive search for the pattern "example" in .txt and .md files using the fd command, you would use:

source $FSS_ROOT_DIR/lib/fd_builder.sh 
fd_add_type "f"
fd_add_extensions "txt" "md"
fd_add_ignore_case
fd_set_pattern "example"
fd_set_path "/path/to/search"
fd_execute

This flexibility can also be beneficial for interactive shell sessions, allowing you to experiment with different search methodologies and refine your approach on the fly.

To integrate the fss.conf file use the config parser. This parser is designed to read the fss.conf file and import configuration settings for the provided section.

For example, to load configurations for images:

source $FSS_ROOT_DIR/lib/config_parser.sh
parse_config "IMAGE"

Once parsed, the configuration settings from the consen section become available as environment variables. This allows for easy access and use in custom scripts.

Tools Overview

Each script in fss/tools offers an efficient approach to searching, previewing, and taking action on various file types. Below, the scripts are described in more detail as for the default configuration:

fimage

fmusic

fvideo

ghist

gkill

gpdf

gword

Each script's behavior can be customized via the fss.conf configuration file, allowing modifications to file extensions, preview commands, and default actions.

Acknowledgments

This suite of search utilities, now a part of this dedicated project, has its roots in my personal journey with dotfiles. Over the years, what started as simple aliases and functions in my shell configurations, driven by my own needs and inspired by various dotfiles from the community, has evolved into a more structured approach. This evolution was marked by the introduction of a centralized configuration file, leading to the creation of this project. These tools have become an integral part of my daily workflow, addressing specific search tasks efficiently.

The core design, architecture, and implementation of the tools and libraries is product of my initiative with personal experimentation and implementation as of my commitment to efficient workflow automation.

While the foundation and primary development of this project are my own, it has been shaped and influenced by a multitude of external factors:

In conclusion, I extend my deepest gratitude to all the developers behind the search tools that have been integral to this project.

License

The FunkyShellSearch is licensed under the GNU General Public License v3.0, see LICENSE.

As this project depends on various external projects, each with its own licensing terms, it is important to be aware of and comply with these respective licenses. Please review the licenses of these projects to ensure compliance with their terms when using fss.