You are not logged in.

#1 2020-03-25 21:53:38

Inspector Parrot
Registered: 2011-11-29
Posts: 23,709

Interrobang II: Fully redesigned launcher menu

Interrobang, just in time for it's seven year aniversary, has been completely renewed.  If you were familiar with the code of the original interrobang, forget everything you knew about it's inner workings: the new version has been created from scratch with an entirely different implementation and design.

But if you loved what the original could do, you will likely find most of the new version's behavior familiar.

What's the same:

  • Bangs! All kinds of bangs each with their own customizable tab completion and launchers

  • Launch binaries, open documents, run .desktop files, and more

  • Potential for "hushbangs": i.e., an invocation that defaults to a specific bang without needing to enter the bang name

What's new:

  • Better tab completion: hit tab to cycle through options without ugly hacks and memory use

  • Custom bangs and tab completion no longer need to be one-liners.  They are each their own script - in fact they can be writen in any scripting or programming language.

  • Two flavors of scripts: 'tab' and 'run' for tab completion and execution

  • No more ugly config file as most flexibility is in the scripts

  • Basic options are configured at compiled time with config.h

  • Xft Fonts!

  • Multiple keymaps which can be called by map labels with command line arguments.  For example, there is a 'default' keymap in config.h already, and an example secondary one called keys_pdf which is named 'pdf' in the keymaps array in config.h.  To override default bindings with pdf bindings, run interrobang with a "+pdf" command line argument.  You can have as many optional/addition key maps as you'd like specifying which ones get loaded with multiple command line arguments (e.g. `interrobang +emacs +pdf').  This is actually how the equivalent of hushbangs from v1 are implemented: the "+pdf" keymap includes tab completition and run commands that default to the pdf bang.

  • Lots and lots of bugs

What's gone:

  • Ugly old inflexible code

  • Displaying of completion "options" (may return in a limited form eventually)

  • Lots and lots of bugs

What's coming soon:

  • Paste function for PRIMARY and CLIPBOARD selection insertion (done)

  • Other line-editing functions?

  • Lots of new bang scripts

Get started with the PKGBUILD below (will be submitted to AUR soon):

# Maintainer: Jesse McClure <code [at] jessemcclure [dot] org>
pkgdesc="A tiny launcher menu packing a big bang (syntax)"
depends=('libxrender' 'libxft')

prepare() {
   rm -rf "${pkgname}" "${pkgname}.fossil"
   mkdir -p "${pkgname}"
   fossil clone "${url}" "${pkgname}.fossil";
   cd "${pkgname}"
   fossil open "../${pkgname}.fossil"

pkgver() {
	cd "${pkgname}"
	echo 2.0b$(fossil info | sed -n 's/check-ins: *//p')

build() {
	cd "${pkgname}"

package() {
	cd "${pkgname}"
	make DESTDIR="${pkgdir}" install

To test out some of the example bangs either copy them over:

cp -a /usr/lib/interrobang $XDG_DATA_HOME
# or
cp -a /usr/lib/interrobang ~/.local/share/

Or just specify a temporary XDG_DATA_HOME pointing to the examples:

export XDG_DATA_HOME=/usr/lib

Documentation of the tab and run scripts will be on the way, but I hope the examples may be clear enough.  EDIT: Oh, I suppose I should mention the environment variables for the scripts.  Interrobang sets a handful of environment variables for each tab or run script in launches:

  • iBangChar = the bang character used (default is '!')

  • iBangBang = the bang called, if any (e.g., pdf, calc, term if the entered line starts with "!pdf ", "!calc " or "!term ")

  • iBangArgs = everything after the first space after the bang if there is one, otherwise all content of the line (this may change eventially to be just the last token).

  • iBangLine = the full line entered so far

  • iBangLast = the previous tab completition result returned to interrobang - used for cycling completion options in tab scripts

  • iBangTemp = a recommended temporary file name to be used by tab completition scripts

  • iBangTabDir = where the tab files are looked for (e.g., $XDG_DATA_HOME/interrobang/tab), not likely useful in scripts

  • iBangRunDir = where run files are (e.g., $XDG_DATA_HOME/interrobang/run), not likely useful in scripts

Tab completion scripts should return one and only one completion option: the next one to be used.  Failure to return a result will indicate there are no suitable completition options.  Any additional lines beyond the first returned will be silently ignored.

Also note for any real use, you may want to modify config.h prior to compiling.  Facilitating this modification, and figuring out why `fossil pull' is failing in the PKGBUILD (resulting in the rm -rf and starting from scratch) are the two hinderances to uploading this to the AUR.  Patches welcome.

Last edited by Trilby (2020-03-28 22:22:17)

"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman


Board footer

Powered by FluxBB