Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give a way to add current desk in the zsh prompt #45

Open
martylamoureux opened this issue Dec 2, 2015 · 8 comments
Open

Give a way to add current desk in the zsh prompt #45

martylamoureux opened this issue Dec 2, 2015 · 8 comments

Comments

@martylamoureux
Copy link

Hi !
Desk is great, but it would be even better if it's possible to show the current desk into the zsh (for instance) prompt, in order to know where we are.

I see in the demo gif in the readme that you have a "(venv)" prepending your prompt, is there anyway to have the something but with the name of the current desk ?

@jamesob
Copy link
Owner

jamesob commented Dec 2, 2015

Hey Marty, thanks for the issue. Thanks to @rnewton and #14, this is pretty easy -- just include ${DESK_NAME} somewhere in your prompt.

For example (using oh-my-zsh), I do

PROMPT=' [%w %T] %B%{$fg[blue]%}%3d%{$reset_color%} $(git_prompt_info) $(git_prompt_status)$(git_prompt_ahead)%{$reset_color%}${DESK_NAME}
 $ '

Does that help?

Maybe we should update the README with some of this info.

@martylamoureux
Copy link
Author

Okay ! it works ! I'm using iTerm + zsh + oh-my-zsh + Agnoster, and I found a way to add a "segment" in the prompt when we are in a desk.

If anybody is interested in it, I can give the instructions to get it.

Example

@jamesob
Copy link
Owner

jamesob commented Dec 3, 2015

Nice @martylamoureux! Maybe we can spin up a wiki page or something.

@vaibhavguptaIITD
Copy link

This is great @martylamoureux! Please share the instructions for this.

@lvancrayelynghe
Copy link

If anybody need this, here is my Agnoster modified theme with Desk integration (and some more goodies)

desk

@mosic
Copy link

mosic commented Feb 14, 2016

I also played around with this today and made a simple zsh theme (based on robbyrussell), you can see it here: https://github.com/mosic/dotfiles/blob/master/zsh/themes/mosic.zsh-theme

It looks like this:

image

Using ◲ in the prompt looks great, thanks for the idea.

@McKean
Copy link

McKean commented Aug 16, 2016

@mosic beautiful, thanks.

@melMass
Copy link

melMass commented Sep 23, 2017

For anyone using powerline9k this is the correct way to use it:

# DESK INTEGRATION
prompt_desk() {
    if [ ! -z "${DESK_NAME// }" ]; then
        "$1_prompt_segment" "$0" "$2" "red" "grey" "$POWERLEVEL9K_DESK_ICON $DESK_NAME" "#"
    fi
}

POWERLEVEL9K_DESK_BACKGROUND="black"
POWERLEVEL9K_DESK_FOREGROUND="white"
POWERLEVEL9K_DESK_ICON='\uf1d8'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants