Skip to main content

Simple CUI (TUI) Launcher menu

Project description

Simple CUI (TUI) Menu

demo/jj-demo.gif

Install

$ pip install jj-menu

( or $ pip install git+https://github.com/ytyng/jj-menu.git )

Setup

Create jjfile.py into any directory.

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import unicode_literals

menu = [
    ('list python processes', 'ps -eafw|grep python'),
    ('move tmp', 'cd /tmp/'),
    ('list dirs', ['ls .', 'ls ..', 'ls ../..']),
    ('Git logs (simple)',
     'git log --graph --date-order -C -M --pretty=format:"<%h> %ad [%an] %Cgreen%d%Creset %s" '
     '--all --date=short'),
    ('Git logs (verbose)',
     'git log --graph --date=iso --decorate --name-status'),
    ('Copy datetime to pasteboard',
     'date +"%Y-%m-%d %H:%M:%S"|pbcopy')
]

And register shell function (Optional)

function jj(){
    RESULT_FILE=/tmp/_jj_result
    jj-menu --result-file=${RESULT_FILE}
    if [ $? == 0 ]; then
        history -s `cat ${RESULT_FILE}`
        source ${RESULT_FILE}
    fi
}

Run

$ jj

or

$ jj-menu

(In not registered jj shell function. Run selected command in subprocess.)

Key binds

ESC: Exit
Q: Exit
k: Up
j: Down

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jj-menu-0.2.1.tar.gz (4.0 kB view details)

Uploaded Source

File details

Details for the file jj-menu-0.2.1.tar.gz.

File metadata

  • Download URL: jj-menu-0.2.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for jj-menu-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9bb01f536f1244f53a0dd428e155f505af2be4c053505daa243c5d86356820da
MD5 b5e9a78119eb0e89fec04c09839aca2f
BLAKE2b-256 97d557b16f5163bd921cf27d4f0de9da06a6c8c825f090b7794d4f81d30d3aed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page