From b3ee05335263e7e5911302e9abe0fa93f33db7bd Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sun, 10 May 2020 19:43:37 +0100 Subject: [PATCH] bin/xduplic-terminal: New script: start terminals for `xduplic-copier'. While `xduplic-copier' is awesome, it doesn't work with terminal emulators built against GTK 3 for bogus `security' reasons. Also, typically, I want to start lots of terminals starting out doing slightly different things. Anyway, this is a simple which opens a bunch of suitable terminals based on tags provided on the command line. --- Makefile | 1 + bin/xduplic-terminal | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100755 bin/xduplic-terminal diff --git a/Makefile b/Makefile index 3a80ad4..3b8d6e5 100644 --- a/Makefile +++ b/Makefile @@ -305,6 +305,7 @@ SCRIPTLINKS += xpra-start-xdummy SCRIPTLINKS += play-rawk SCRIPTLINKS += media-keys SCRIPTLINKS += disorder-notify +SCRIPTLINKS += xduplic-terminal DOTCPP += .Xdefaults Xdefaults_DEFS = -DEMACSWD=$(call mdw-conf,emacs-width,77) diff --git a/bin/xduplic-terminal b/bin/xduplic-terminal new file mode 100755 index 0000000..eb094a5 --- /dev/null +++ b/bin/xduplic-terminal @@ -0,0 +1,27 @@ +#! /usr/bin/zsh -e +### make terminals suitable for xduplic-copier + +prog=${0##*/} +usage () { echo "usage: $prog TAG ... -- COMMAND ARGS"; } + +typeset -a tags cmd c +typeset -i i=1 +typeset tag + +for ((; i <= $#; i++)); do + if [[ $@[i] = "--" ]]; then break; fi + tags+=($@[i]) +done +if (( i > $# )); then usage >&2; exit 2; fi +i+=1 +for ((; i <= $#; i++)); do cmd+=($@[i]); done + +for tag in $tags; do + c=(${cmd//{}/$tag}) + xterm -xrm "XTerm*allowSendEvents: true" \ + -geometry 80x35 -title "xduplic: $c" \ + -e $c& +done +sleep 0.5 +xduplic-copier& +wait -- 2.11.0