summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-08-24 21:06:48 +0300
committerThomas Voss <mail@thomasvoss.com> 2023-08-24 21:06:48 +0300
commit4a10cb0184a83bc1a0af694b6ea9c3875dbf5031 (patch)
tree321435593f1c45008f8aa632290a3e277393f438
parent868fc8fd16ee08f3c941ffb74e7a089b185120c0 (diff)
osel: Fail on no output & require wofi/fzf
-rwxr-xr-x.local/bin/osel12
1 files changed, 9 insertions, 3 deletions
diff --git a/.local/bin/osel b/.local/bin/osel
index 885c048..c289b19 100755
--- a/.local/bin/osel
+++ b/.local/bin/osel
@@ -1,5 +1,11 @@
#!/bin/sh
-: ${OSEL_GUI:=wofi -d}
-: ${OSEL_TERM:=fzf}
-if [ -t 2 ]; then eval $OSEL_TERM; else eval $OSEL_GUI; fi
+x="`
+if [ -t 2 ]
+then
+ eval fzf $OSEL_TERM_FLAGS
+else
+ eval wofi -d $OSEL_GUI_FLAGS
+fi`"
+[ -z "$x" ] && exit 1
+printf '%s' "$x"