Code Monkey home page Code Monkey logo

openbox-command-palette's Introduction

openbox-command-palette

Parses Openbox menu config, or pipe menus, flattening output into a list suitable for use by other scripts.

If you're like me and use Openbox menus (and pipe menus) extensively on your desktop this makes it easier to not waste that effort while using other desktop environments :)

Right now there isn't anything to configure, e.g. separators. Please open an issue if you'd find this useful.

Installing

Using cargo (a shell.nix is provided for Nix users):

# will install to ~/.cargo/bin/openbox-command-palette
$ cargo install --git https://github.com/ZaneA/openbox-command-palette

Usage

Basic usage

$ openbox-command-palette
Usage: openbox-command-palette <path to wrapper> <path to openbox menu.xml or pipe menu command>

For example:

$ openbox-command-palette wrapper.sh ~/.config/openbox/menu.xml
terminal                                     # xterm
files                                        # thunar
a pipemenu                                   # wrapper.sh "pipemenu-script"
system audio volume                          # pavucontrol
system audio patchbay                        # helvum

Usage with a wrapper

openbox-command-palette expects to be used within a user-defined wrapper script that will pass the output to a suitable UI. This is crucial for navigating through pipe menus.

An example using rofi/dmenu or xmenu would look like:

#!/usr/bin/env bash
# rofi
OUTPUT=$(~/.cargo/bin/openbox-command-palette "$0" "$1" | rofi -dmenu)
# xmenu
#OUTPUT=$(~/.cargo/bin/openbox-command-palette "$0" "$1" | xmenu -r -i)
IFS='#'; arrOUTPUT=(${OUTPUT}); unset IFS
COMMAND=${arrOUTPUT[1]##*( )}
if [ -n "$COMMAND" ]; then
    sh -c "$COMMAND" &
fi

This will provide a filterable command-palette style launcher, and allow you to navigate through pipe menus (i.e. re-launching the wrapper with the new menu).

openbox-command-palette's People

Contributors

zanea avatar

Stargazers

 avatar

Watchers

 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.