commit ef45fce1b8a6481cace389b8bd2f25d75b4cdb1b parent c080c528e72778f68772b3a14c3693fa118211df Author: Alex Balgavy <alex@balgavy.eu> Date: Fri, 11 Nov 2022 11:57:08 +0100 insertinput: type text on stdin Diffstat:
A | scripts/insertinput | | | 17 | +++++++++++++++++ |
1 file changed, 17 insertions(+), 0 deletions(-)
diff --git a/scripts/insertinput b/scripts/insertinput @@ -0,0 +1,17 @@ +#!/bin/sh +read -r ipt +os=$(uname -s | tr '[:upper:]' '[:lower:]') +case "$os" in + linux*) + # code for Linux + ;; + darwin*) + osascript -e "tell application \"System Events\" to keystroke \"$ipt\"" + ;; + msys*|cygwin*|mingw*|nt|win*) + # code for Windows + ;; + *) + printf "Operating system %s is unknown.\n" "$os" + ;; +esac