Original post was regarding using a script to make an application appear on a particular workspace, such that another script might be used in Start Up script to allow a user to continue working while a very slow starting application loaded on another workspace. My script works great as front-end for the rather cumbersome wmctrl syntax, to launch any one application on any given workspace, from any command prompt. Thus a further script that simply lists something like, lh 1 thunderbird; lh 2 firefox; lh 3 calculator...., or whatevever, is now easy. There are however some difficulties with timing, thus the sleep in my script. The below is updated version, which I will not be maintaining or post again. Use AS IS, no guarantee of fitfulness for any particular use. Modify as you please. I suggest saving as /usr/local/bin/lh, simply because lh is not any other known program name, at least not on Mint 18. As for variables--I quoted variables I deemed necessary to be quoted.
## Author: B.A. Computer Services www.bornagaincomputer.com
## Purpose: Frontend to launch anything on a specific desktop/workspace.
## lh is short for LaunchHere
USAGE="USAGE: $(basename $0) [-r] workspace(1,2,..) command\
LaunchHere launches COMMAND on specific workspace.\
-r option returns to current workspace"
[ -z "$1" ] && echo $USAGE && exit 0
ISRETURN=$(false); [ "$1" = "-r" ] && ISRETURN=true && shift;
WRKSPC=$1;[ -z "$WRKSPC" ] && echo $USAGE && exit 0
WSN=$(expr $WRKSPC - 1) ## wmctrl starts with 0 as first wrkspc
shift; CMD="$*"; [ -z "$CMD" ] && echo $USAGE && exit 0
WM=$(which wmctrl);[ -z "$WM" ] && echo MISSING wmctrl && exit 1
CURRENT=$(wmctrl -d | grep '*' | cut -c1)
# Switch to desired workspace
$WM -s $WSN
echo Executed $CMD on workspace $WRKSPC, PID=$PID
# Return to CURRENT workspace ?
# [ $ISRETURN ] && echo TRUE || echo FALSE
[ $ISRETURN ] && $WM -s $CURRENT