deanishe / alfred-ssh

Open SSH/SFTP/mosh connections from Alfred 3+

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for iTerm badge

cpoissonnier opened this issue · comments

I would LOVE to have the best of two workflows :

Do you think it could be implemented ?

Thanks very much!

I don't think the feature is very appropriate for this workflow. It's an iTerm-specific feature, and this workflow doesn't know anything about iTerm or any other application. It's designed to work with Alfred's standard Terminal Command (and therefore any terminal emulator Alfred supports) or any application that supports ssh:// (or sftp://) URLs. I'm not sure that iTerm's badges are sufficiently amazing to change the way the workflow works.

I don't know exactly what you want to show in the badge, but if setting it to \(session.hostname) is no good, you could try setting SSH_CMD to point to a custom script that sets the badge to something else (perhaps the short hostname?)

As I understand it, you can also set badges from within the shell, so you could perhaps add code to your .bashrc or equivalent that checks to see if it's running via SSH (e.g. by checking for the presence of $SSH_CLIENT), and if so, sets an appropriate badge.

I totally get it, no problem !

\(session.hostname) would work if the server I use were properly named. That's unfortunatly not the case, some of them have confusing names, that's why it would be perfect if the badge was the host name used in ~/.ssh/config

I managed to do it by changing the "Open URL" step by some AppleScript that set the user variable I want, and then, open the ssh session.

Your solution is much more elegant, I admit, but it works for my very specific use case.

Thanks again for what you do for the community, I just browsed your repos, and realize that I use a lot of your workflows :)

Your solution is much more elegant, I admit, but it works for my very specific use case.

More of a workaround to avoid changing the workflow, tbh.

Glad you got it working they way you like.