
Desk: A lightweight workspace manager for the shell - ingve
https://github.com/jamesob/desk
======
zimbatm
self plug: [http://direnv.net/](http://direnv.net/) does basically the same
but without having to start new sub-shells. Just `cd` into a folder, if it has
an .envrc file it's loaded. If you `cd` out of the folder all the changed
environment variables are restored.

~~~
nitrogen
Does it have a trust model to prevent loading a .envrc from unknown origin?

~~~
zimbatm
Yes, the file path+content checksum is verified against a whitelist before
execution. Typing `direnv allow [PATH]` adds it to the whitelist.

------
venning
I believe this was on the front page of HN 20 days ago. This time the URL has
a hash fragment. See here for 9 comments:

[https://news.ycombinator.com/item?id=10445461](https://news.ycombinator.com/item?id=10445461)

------
such_a_casual
Am I understanding this right? This is basically just a command to call bash
scripts that live in a certain directory? Why not just use:

. path/to/ez_lisp.sh

\----------------------

or use an alias like:

desk() {

    
    
      . path/to/$1
    

}

I'm a newb. So sorry if this is just over my head.

~~~
jobeirne
Yes and no... the details are a little different, because we're using
subshells and not sourcing scripts directly in the current process (cleanup is
easier that way -- you just `exit`). But in effect, yeah, this is minor window
dressing around executing an initializing shell script in a sandbox. I find
the interface and the doc surfacing useful.

In the nearterm I'm going to be working on supporting imports -- i.e., you
`git clone` down a project that has a deskfile at its root, then you're able
to import it (maybe as a fancy symlink) into your own deskfiles. That'd give
you immediate, programmtic context for working on the project.

------
xbeta
Or just a simple tmux session?

~~~
greggyb
It's more than just a tmux session, because it's also setting up an
environment for the "workspace" as well. You might even use it with tmux to
quickly load the appropriate environment in a new session.

~~~
lojack
Worth checking out tmuxinator which essentially does this. The way I use
tmuxinator, I just type 'mux <name>' and it'll load a tmux session with all my
panes, directories, and applications loaded and running.

------
erikb
I really want to support open source efforts. But I really can't if there's a
project developed without any googling before the first line of code. We have
terminal multiplexers. I don't know but I wouldn't be surprised if he had one
when computer still meant big tubes and real typewriters being connected to
screens. This project doesn't offer anything that screen or tmux can't do, as
far as I understand the README. And it also doesn't mention its biggest two
competitors.

Please, to save your own time and energy (if not the time and energy of other
people) search for a solution before you build one. Only if you have found the
two or three solutions that the community likes most and you are still
unsatisfied, only then start coding. And set yourself a real goal about what
your tool should be doing that the others don't.

In this example tmux is quite interesting. Screen was around for ages. But a
few things were not possible with the screen code base, like splitting your
screen in whatever way you want. And some things simply were not really user
friendly, like the config. With this in mind a guy named Nicholas Marriott sat
down and started coding his alternative.

That's how you do it. Stick his picture on your wall. Follow his path. Start
with googling for your problem, not with coding.

PS: I think the idea of having different desktops in graphical shells in fact
came from people wanting to have the terminal multiplexing feature in their
graphical environment as well. So Desk is like taking your calculator apart to
develop a method to calculate with pen and paper.

~~~
hyyypr
Love tmux, fail to see how desk and tmux are related. I think you missed the
point.

Wheb i boot up, i still have to ^R to cd to the right location, and then ^R
again to "compile" etc.

I'm looking forward to trying this out, direnv (mentionned above) seems like
an even better idea.

~~~
vive-la-liberte
I have four directories which I frequently use. For one of them, I commit as
let's say me@example.com and in the other three as me@example.edu.

So first of all, I have a bash function declared in my bashrc which takes one
argument -- the domain -- and sets a few evironment variables such as
GIT_AUTHOR_EMAIL and GIT_COMMITER_EMAIL.

Next I have one two-letter alias and three three-letter aliases which all cd
to their respective paths and call the function to set the env vars.

Finally, I have two-letter aliases to git add, git diff, git commit, git push
and so on.

Dead simple and works great. All I need is my bashrc.

