You are not logged in.

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

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

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>
pkgname=interrobang-dev
pkgver=2.0b2
pkgrel=1
pkgdesc="A tiny launcher menu packing a big bang (syntax)"
url="https://code.jessemcclure.org/interrobang"
arch=('x86_64')
license=('MIT')
depends=('libxrender' 'libxft')
makedepends=('fossil')

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}"
	make
}

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
interrobang

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

Offline

#2 2020-10-06 23:00:56

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: Interrobang II: Fully redesigned launcher menu

I hope this post does not count as necrobumping ...

How could I have overlooked this? sad

Great News.

Regarding the PKGBUILD: I do not see any way to avoid removing and recloning, but I do not know fossil well. The fossil pull command really acts pretty strange to me. Regarding the config.h thingy:

# Maintainer: Jesse McClure <code [at] jessemcclure [dot] org>
pkgname=interrobang-dev
pkgver=2.0b14
pkgrel=1
pkgdesc="A tiny launcher menu packing a big bang (syntax)"
url="https://code.jessemcclure.org/interrobang"
arch=('x86_64')
license=('MIT')
depends=('libxrender' 'libxft')
source=("${pkgname%-dev}.h")
md5sums=('SKIP')
makedepends=('fossil')

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

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

build() {
	cd "${pkgname}"
	make
}

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

Offline

Board footer

Powered by FluxBB