desk icon indicating copy to clipboard operation
desk copied to clipboard

Load a desk without launching a new shell instance

Open dead10ck opened this issue 9 years ago • 2 comments

It would be nice if there was a desk load or some such subcommand which would load a desk's script without leaving the current shell instance. This would be useful for allowing one to share some common desk setup among other desks. For instance, say I want to have some script setup some environment variables that will be common to other desks as well. Currently, as far as I can tell, the only way to do this is with something like:

# load the common code
. $(dirname $0)/common.sh

# start setting up the subdesk

when it would be much nicer just to be able to do something like:

# load the common code
desk load common

# start setting up the subdesk

dead10ck avatar Nov 16 '15 21:11 dead10ck

Yeah, and there's certainly a usecase for desk reload (after you've desk edited something and want to incorporate the changes into a current shell session).

One snag here is that I'm unsure of how we'd inject environment variables into a parent process; i.e. when you call desk load common, that's going to spawn off a child process from your current shell session. Are you aware of a way communicate that sourced data in common.sh back up to the parent process?

jamesob avatar Nov 17 '15 18:11 jamesob

Also this would not break screen titles... Currently each screen running a desk simply shows ''desk'' as its name instead of the currently running task (because desk is the currently running task).

8191 avatar Nov 21 '15 12:11 8191