From 268a90b940fd676c4b19ab3cc23b434c271e201b Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Sat, 23 Jan 2021 22:46:24 +0100 Subject: [PATCH] add combining snippet/exec script --- local/bin/delegator | 51 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 local/bin/delegator diff --git a/local/bin/delegator b/local/bin/delegator new file mode 100755 index 0000000..0ffe00c --- /dev/null +++ b/local/bin/delegator @@ -0,0 +1,51 @@ +#!/bin/sh + +set -e + +if [ -t 1 ]; then + pick() { + sk + } + inject() { + echo "$@" + } +else + window="$(xdotool getwindowfocus)" + pick() { + dmenu -i -l 10 + } + inject() { + xdotool type --clearmodifiers --window "$window" "$*" + xdotool windowfocus "$window" + } +fi + +choice="$(pick <