From 5c4318a022a55950f769d5943cbe16e7241c2de6 Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Fri, 23 Jun 2017 13:24:45 +0200 Subject: [PATCH] attach from terminal with fzf --- local/bin/abduco | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/local/bin/abduco b/local/bin/abduco index 62fd57c..b1fb45f 100755 --- a/local/bin/abduco +++ b/local/bin/abduco @@ -1,8 +1,16 @@ #!/bin/bash +if [ -t 1 ]; then + pick() { fzf --height 10; } + run() { /usr/bin/abduco -A "$@" "$@"; clear; } +else + pick() { dmenu; } + run() { exec st -e /usr/bin/abduco -A "$@" "$@"; } +fi + result="$(case "$1" in - list) find ~/.abduco -not -executable -type s -exec basename \{\} \; | cut -d@ -f1 | dmenu ;; - run|watch) dmenu_path | dmenu ;; + list) find ~/.abduco -not -executable -type s -exec basename \{\} \; | cut -d@ -f1 | pick ;; + run|watch) dmenu_path | pick ;; *) echo "other" ;; esac)" @@ -13,8 +21,7 @@ if test "$result" = "other"; then fi case "$1" in - list) exec st -e /usr/bin/abduco -A "$result" ;; - watch) result="watch $result" ;& - run) exec st -e /usr/bin/abduco -A "$result" $result ;; + watch) result="watch $result" ;& + list|run) run $result ;; esac