desk
desk copied to clipboard
Load a desk without launching a new shell instance
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
Yeah, and there's certainly a usecase for desk reload
(after you've desk edit
ed 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?
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).