Coder Social home page Coder Social logo

nightsun's Introduction

nightsun

Nightsun is a fast, modular fuzzy picker designed to simplify desktop searches for items like browser tabs, tmux sessions, and project directories. It aims to replicate the functionality of Neovim's Telescope or VSCode's command palette, facilitating quick access and switching between tasks without excessive keyboard shortcuts.

Installation Instructions

NixOS Users
  1. Clone the Repository: First, clone the repository to your local machine.
  2. Install: Use the command nix profile install . to install the software into your profile.
Other Systems
  1. Download the Binary: Visit the releases page and download the latest binary.
  2. Add to Path: Move the downloaded binary to a directory within your path, or add its directory to your path for easy access.

Creating and Compiling Custom Modules for Nightsun

Creating custom modules for Nightsun allows you to tailor its functionality to your specific needs, enhancing your desktop environment for productivity. Modules in Nightsun are compiled to Bash functions, enabling seamless integration and the ability to call other modules by name. This guide will walk you through creating a custom module, including the use of aliases to abstract differences between similar functionalities (e.g., different window managers).

Step 1: Understand Module Components

  • Name: The unique identifier for your module.
  • Description (desc): A brief overview of what your module does.
  • Prefix: An optional text that prefixes the items generated by your module.
  • Producer: A command or script that generates a list of selectable items.
  • Consumer: The action to perform with the selected item. This is compiled into a Bash function.
  • Alias: Specifies another module's name to use its functionality, abstracting differences between similar modules.

Step 2: Define the Producer

Identify how to generate the list of items your module will work with. This step is crucial for guiding the user's selection process. For example, use ls to list files in a directory or git branch to list all branches in a git repository.

Step 3: Design the Consumer

This is the action your module will perform on the user's selected item. The consumer is compiled into a Bash function, allowing it to perform complex actions or even call other modules by name. Ensure your consumer command or script accurately manipulates the selected item as intended.

Step 4: Utilize Aliases for Flexibility

Aliases allow your module to call the functionality of another module, offering flexibility and abstraction. For instance, if your module needs to focus on a window but should work across different window managers, you can alias it to specific modules designed for each window manager (i3, hyprland, etc.), abstracting the window manager's complexity from the user.

Step 5: Write Your Module

Combine the components above into your module definition. Here's a simplified template:

- name: my_custom_module
  desc: "A brief description of what the module does."
  prefix: "Optional prefix"
  producer: "Command to produce a list of items"
  consumer: |
    "Command or script to act on the selected item."
  alias: "Optional: Name of another module to alias this module to."

nightsun's People

Contributors

42loco42 avatar nilsherzig avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.