Git Product home page Git Product logo

commandpalette's Introduction

Palette

Using Palette, you can do anything from just your keyboard. Open websites, applications, games, control your music, and open/manage windows all from the same place, with a simple sequence of keypresses. No more wondering if Windows Start Menu supports what you want to do.

Summon Palette at will with a keyboard shortcut (Ctrl-Shift-Alt-P by default). Dismiss it with any number of actions. Palette seeks to be as inobtrusive and hidden as possible. Use command tags and Palette's complex character matching features to quickly find your command in a short sequence of characters (find out more here). I made this project in the hopes of accelerating my workflow, and I hope it can do the same for you.

image

Features

As of right now, Palette can:

  • Open websites (acting as a unified bookmark system)
  • Run scripts in shells like Powershell and Git Bash
  • Control your Spotify
  • Run applications
  • Open and close windows

Controls

# Opening and Hiding the Palette:
Ctrl+Shift+Alt+P (Windows)
Option+Shift+P (MacOS)

Enter executes the highlighted command
Tab tabs through the available commads
Esc hides the Palette
Ctrl+R refreshes the Palette and reloads the commands

Installation

Palette is currently available on Windows and Mac. Go ahead and download from the Releases section!

Architecture

Palette contains an Electron client that serves the GUI, alongside a Python FastAPI server that provides and executes commands. The Electron renderer uses Next JS to build its UI.

image

The Palette client can GET commands from the backend and tell the backend to execute a command with POST run-command. When the Palette client spawns, it will spin up the backend server. But in the case that the UI creates before the backend is alive, the client will repeatedly ping the backend's health endpoint, and retrieve the backend's provided commands when it comes to life.

The Palette client's frontend is generated by Next JS and packaged into the Electron application.

Developing

First, pull the repo.

Backend setup

Create the python virtual environment (in /backend, most likely). Install pip requirements from /backend/requirements.txt

Commands to do so:

cd backend
python -m venv .venv

source .venv/bin/activate # mac/linux
source .venv/Scripts/activate # windows

pip install -r requirements.txt

You can now start the backend with the following command.

# In /
make backend

This will spawn the FastAPI server with reload enabled, meaning changes made to the source code will trigger hot reloads.

Frontend setup

Electron uses Node JS so we will need at least Node 14. Perform the following commands to install the required node modules.

cd frontend
npm install

To start the frontend, run

# In /
make frontend

This will spawn the NextJS dev server and the Electron client. In a moment, you should see the Palette appear on screen.

Go to tutorials/ to see a couple of tutorials on ways you can contribute to this project.

TODO

  • Make it so you can spawn the Palette backend separately, and connect Palette clients to it
  • Permit Palette clients to connect to multiple Palette backends
  • Persist command MRU to disk

commandpalette's People

Contributors

shouhanzen avatar

Stargazers

morebytes avatar Claire avatar

Watchers

 avatar

commandpalette's Issues

Bounty: Extended Input

Permit users to submit more input after the initial command execution (like parameters, for example)

  • Modify command execution flow. Do we encode a parameters field in the command that gets read by the renderer?
    • Consider UX costs: rich UI preferable, but user flow between various rich panels hard to encode.
    • Should probably start with a simple parameters system and extend that to begin with.

Bounty: Custom scripts/sites from user preferences

Permit users to add their own custom scripts/sites and store the data for that in wherever Electron's user preferences are.

  • Figure out where Electron places its user preferences
  • Read from it and provide appropriate commands
  • Add commands that edit the preferences (requires new renderer panels for input)

Bounty: Help command

Add a help command that when executed, keeps the user in the Palette UI and opens a text panel somewhere on screen that contains the help text.

Optionally, this help text can be encoded as markdown

Bounty: Command parameters

Parameter system works as follows:

Have some key that when hit (like the minus key, pipe, or something), will select the command to be executed.

Next, the command will show all available parameters that can be assigned to, in the command listing section. For example, if "filepath" is a parameter, itll appear as an autocomplete option that can be selected through the typical palette interface.

Then, if what's needed next is a value or another parameter, it'll all be fed in naturally and selectable through the search system.

Like this, we can quickly execute a command such as
add web bookmark | title="Google" | description="search for stuff here" | url="google.com"

Or
base64 | encode | abcdefg

Or
chatgpt | who is the real slim shady?

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.