aboutsummaryrefslogtreecommitdiff
path: root/helpers/bbpick
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2020-02-24 03:39:44 -0800
committerBruce Hill <bruce@bruce-hill.com>2020-02-24 03:39:44 -0800
commit88fd9c416be0f5fe1e5fd48ba7c27d4d1e25261c (patch)
treecfe311fb81c1d12e46b08de175a6296f0aed7a0d /helpers/bbpick
parent304cbddf730b86dec2b3d7c414fd0b9a38c69d76 (diff)
Moved bbstartup into a script, renamed helper/ -> scripts/, and added
bbshutdown script. Also tweaked some of the precedence.
Diffstat (limited to 'helpers/bbpick')
-rwxr-xr-xhelpers/bbpick39
1 files changed, 0 insertions, 39 deletions
diff --git a/helpers/bbpick b/helpers/bbpick
deleted file mode 100755
index 3316484..0000000
--- a/helpers/bbpick
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-# Pick from the provided input
-if [ -z "$PICKER" ]; then
- if command -v fzf >/dev/null; then
- PICKER=fzf
- elif command -v fzy >/dev/null; then
- PICKER=fzy
- elif command -v ask >/dev/null; then
- PICKER=ask
- elif command -v dmenu >/dev/null; then
- PICKER=dmenu
- elif command -v pick >/dev/null; then
- PICKER=pick
- fi
-fi
-
-case "$PICKER" in
- fzf)
- printf '\033[3A\033[?25h' >/dev/tty
- fzf --read0 --height=4 --prompt="$(printf "$1")"
- ;;
- fzy)
- printf '\033[3A\033[?25h' >/dev/tty
- tr '\0' '\n' | fzy --lines=3 --prompt="$(printf "\033[1m$1\033[0m")"
- ;;
- ask)
- ask --read0 --prompt="$(printf "$1\033[?25h")"
- ;;
- dmenu)
- tr '\0' '\n' | dmenu -i -l 10 -p "$(printf "$1")"
- ;;
- pick)
- printf '\033[?25h' >/dev/tty
- tr '\0' '\n' | pick
- ;;
- *)
- query="$(bbask "$1")" && grep -i -m1 "$(echo "$query" | sed 's;.;[^/&]*[&];g')"
- ;;
-esac