Giter VIP home page Giter VIP logo

pyunch's Introduction

pyunch

v0.3.1

Build Status Coverage Status

pyunch is a minimal process launcher inspired by dmenu.

Invoke it, start typing, hit enter when the entry you want to run is highlighted.

Quickstart

$ pyunch-index

$ pyunch

Explanation

pyunch, by default, reads $HOME/.config/pyunch/indices, collects JSON documents in reverse sort order, and updates a dictionary with their contents. The dictionary keys become the values displayed by pyunch, while the list values are then supplied to subprocess.Popen().

pyunch-index is a command line utility for generating indices of executables from file system paths. By default it will scan all the paths in $PATH, gathering executables and generating an index that will be written to $HOME/.config/pyunch/indices/1-path_index.json.

Help

$ pyunch --help
usage: pyunch [-h] [-i INDEX_DIR] [-x WIDTH] [-y HEIGHT]
                   [--yposition YPOSITION] [--xposition XPOSITION]
                   [--xoffset XOFFSET] [--yoffset YOFFSET]
                   [--background BACKGROUND] [--foreground FOREGROUND]
                   [--activeBackground ACTIVEBACKGROUND]
                   [--activeForeground ACTIVEFOREGROUND]
                   [--disabledForeground DISABLEDFOREGROUND]
                   [--highlightBackground HIGHLIGHTBACKGROUND]
                   [--highlightColor HIGHLIGHTCOLOR]
                   [--insertBackground INSERTBACKGROUND]
                   [--selectColor SELECTCOLOR]
                   [--selectBackground SELECTBACKGROUND]
                   [--selectForeground SELECTFOREGROUND]
                   [--troughColor TROUGHCOLOR] [--version] [-f FONT]
                   [--font-size FONT_SIZE]

optional arguments:
  -h, --help            show this help message and exit
  -i INDEX_DIR, --index-dir INDEX_DIR
                        The directory containing the json indices
  -x WIDTH, --width WIDTH
                        The width of the window
  -y HEIGHT, --height HEIGHT
                        The height of the window
  --yposition YPOSITION
                        The y position (top, bottom, or center) of the window
  --xposition XPOSITION
                        The x position (left, right, or center) of the window
  --xoffset XOFFSET     The offset to apply to the x position
  --yoffset YOFFSET     The offset to apply to the y position
  --background BACKGROUND
  --foreground FOREGROUND
  --activeBackground ACTIVEBACKGROUND
  --activeForeground ACTIVEFOREGROUND
  --disabledForeground DISABLEDFOREGROUND
  --highlightBackground HIGHLIGHTBACKGROUND
  --highlightColor HIGHLIGHTCOLOR
  --insertBackground INSERTBACKGROUND
  --selectColor SELECTCOLOR
  --selectBackground SELECTBACKGROUND
  --selectForeground SELECTFOREGROUND
  --troughColor TROUGHCOLOR
  --version             Print the version and exit
  -f FONT, --font FONT
  --font-size FONT_SIZE
$ pyunch-index --help
usage: pyunch-index [-h] [--no-environmental] [--recurse] [-p PATH]
                    [-d OUT_DIR] [-f OUT_FILE] [--update]

optional arguments:
  -h, --help            show this help message and exit
  --no-environmental    Don't grab the $PATH environmental variable
                        automatically
  --recurse             Recursively scan provided paths. WARNING: THIS CAN
                        MAKE THINGS RUN SLOWLY IN DEEP DIRECTORY STRUCTURES.
  -p PATH, --path PATH  Manually specify paths to parse looking for
                        executables.
  -d OUT_DIR, --out-dir OUT_DIR
                        The directory to save the index to
  -f OUT_FILE, --out-file OUT_FILE
                        The file name to save the index to
  --update              Update a file which is already in place

Author

Brian Balsamo [email protected]

pyunch's People

Contributors

bnbalsamo avatar

Stargazers

Nikolay Debroh avatar

Watchers

James Cloos avatar

pyunch's Issues

Enter breaks when focus is in list

If the listbox has focus striking enter doesn't launch the highlighted program.

This might also be a good time to implement launching via clicking on the entry in the listbox as well.

pyunch-to-aliases feature

It may be useful to make pyunch indices into aliases for inclusion in .bashrc files and the like, if someone takes the time to manually create an index.

The reverse of this may also be useful.

I'm thinking (right now) something like:

from shlex import quote, split

# Turn index entries into alias lines
def to_aliases(index):
    for k in index:
        print("alias '{}'='{}'".format(k, quote(" ".join(index[k])))

The reverse is more complicated, due to handling of different quoting/escaping.

Config File

Provide the ability to use a config file to specify default arguments passed to the App object in the config directory (eg: ~/.config/pyunch/pyunch.conf)

Font Selection

The CLI should provide the ability to specify a custom font

This font should probably be applied to the Listbox and the Entry

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.