Jump to content

isometry

Member
  • Posts

    47
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by isometry

  1. Your iTerm ssh: handling Profile needs to specify the Command as ssh $$HOST$$ (prefix ssh with the appropriate path if you've installed a new version through MacPorts/homebrew/fink). zsh shouldn't come into it. See post #8 in this thread.
  2. Inspired by samvlu and MattCheetham here, I thought I'd try something a little different from my other workflows. I present iTunes Movie Trailers Search with poster icons. Find a movie by title and hit enter to open the movie trailer page in your default browser. Comments and pull requests welcome. Are the posters – as I suspect – a waste of time, bandwidth and space? Download / Source Note: initial population of the poster cache can take a few seconds, so give your first few searches time to complete. Usage trailer avenge # "Captain America: The First Avenger" + "The Avengers" trailer latest # Special case: return Apple's "Just Added" listing -- Robin
  3. Oops. Not sure how that one slipped through. Download and source now fixed.
  4. ...and another update to add the 'pman' keyword to render and open PDF man pages in your default PDF reader.
  5. I wasn't keen to rely on additional third-party software. However, I have just updated the workflow with another keyword: 'hman' will open a HTML copy of the man page in Safari; change to Chrome or your browser of choice by tweaking the BROWSER variable at the top of the hman Run Script your default browser. Known issue: some pages aren't rendered properly in HTML (a groff bug?). Any tips on how to fix this gratefully received.
  6. A deceptively simple workflow to process the contents of the clipboard through your one-liner of choice. Behind the scenes this is just running pbpaste | {query} | pbcopy, so its power is limited only by your skill at the command line and imagination Download / Source Note: Alfred 2 currently strips hotkey settings for safety, so if you want to initiate the prompt by hotkey for extra ninja-fu, you'll need to set your own. I personally favour Cmd+Shift+| Robin
  7. Hi, I'm looking to build a "pipe" workflow which will fire on hotkey, taking the currently selected text in the foreground application, allow you to specify a shell pipe to pass the text through, then copy the result to the clipboard. I've already got a hack-ish workflow for this: Keyword (| with space, Argument Required) => Run Script (/bin/zsh) { pbpaste | {query} | pbcopy } It would be nice to be able to set a hotkey though (as things stand, I have to choose between passing the selected text to the Run Script or being able to enter the command), and ideally it should be possible to to pass the foreground selected text in to a Run Script or Script Filter in another token, thus saving the requirement to initially copy the text to the clipboard. I would suggest a new "Selected Text" Input with a token named {selected}. There are various other ways this would be useful, e.g. "Mail selected text to…" Thoughts? Robin
  8. Thanks, nikipore. I'd already fixed the issue via another means, but your fix is cleaner. I've integrated your tweaks, and download links/GitHub are updated.
  9. You've probably seen it already, but you might find my SSH workflow more powerful. It supports username override and smart-completes hostnames based on the contents of ~/.ssh/config, ~/.ssh/known_hosts, /etc/hosts and (optionally) Bonjour: Thread and direct download
  10. I think I've fixed the problem. I was assuming that you had both ~/.ssh/config and ~/.ssh/known_hosts. The workflow barfed if either was missing; now it doesn't.
  11. Are you running the latest version from GitHub? v0.9 was badly broken if you didn't have pybonjour installed (which you probably don't). Is your ~/.ssh/known_hosts file hashed? If you're comfortable running the workflow via the console, that would be most informative. Change to the workflow's directory (e.g. Alfred.alfredpreferences/workflows/user.workflow.E2B2A958-21D2-42ED-B6DF-06AF15C6A201 - the GUID may be different, find it via the "Open workflow folder" button when you double click the Script Filter object), and manually fire off the workflow: /usr/bin/python -c "from alfredssh import complete; complete('com')" (where 'com' is a sample hostname you'd expect to return something). Assuming this raises an error, the output should pinpoint the problem.
  12. Open man pages with name and section filtering. The 'man' keyword exploits the x-man-page: protocol handler, so will default to opening in Terminal.app but can easily be switched to iTerm2.app. 'hman' opens pages in your default browser, and 'pman' opens PDFs in the default PDF reader. Download / Source Usage man open(1) # open a specific page pman style # open a PDF of the style(9) manpage man open # search all sections for pages matching 'open*' man *open # search all sections for pages matching '*open*' man 2 open # search section 2 for pages with 'open' in the name Enjoy.
  13. The workflow has been updated to v1.0: finalising(?) the code refactoring, moving the binary to github, and adding source attribution for each suggested hostname completion.
  14. Oops. v0.8 was broken if you didn't have pybonjour installed. v0.9 resolves the issue.
  15. Peculiar - it's reporting 190 downloads of the latest version. Anyway, I've just updated to v0.8 with a refactoring of the code and the addition of tab autocompletion.
  16. nikipore, Your suggestion has its merits, though as described I believe it would be best implemented in a different workflow. This one attempts to be independent of the user's chosen terminal emulator by exploiting the ssh: protocol handler. As such, it supports not just Terminal.app but also iTerm.app, iTerm2.app and any others I don't have personal familiarity with. Having said that, I do like the idea of a workflow to support management of background ssh tunnels, so I may look at that :-) Robin
  17. Indeed. I was trying to avoid the need to special case, but it is ugly… I've updated to v0.61.
  18. I like it. I've just posted v0.6 which includes a variant of your patch (deals with all the ssh_config pattern characters) and Bonjour discovery, along with much better error handling (e.g. complete failure if you didn't actually have a ~/.ssh/known_hosts or ~/.ssh/config file). Enjoy!
  19. I had considered adding parsing of .ssh/config, but mine contains a lot of wildcards and other such cruft. Once you've connected to a host once, it's in your .ssh/known_hosts and good-to-go evermore. Does this addition make your workflow noticeably better? NB: I've already added Bonjour autocompletion to my development version, including full Back to My Mac support. Will post soon.
  20. Simply include the username in your host specification: it does "the right thing". I.e. `ssh user@host` or `ssh user@123`
  21. For your iTerm2 ssh: protocol handler profile, you can set the Name to $$HOST$$ and the Command to $$ to have it automatically set the window/tab title to the name of the host you're connecting to (including username, if specified) and save it spawning a copy of your default shell to simply run ssh. Update 2013-08-12: Changed the recommended Command to simply $$ from ssh $$HOST$$. The latter incorrectly threw away the username if specified.
  22. This one has been at the top of my Alfred wishlist since I downloaded my first Alfred v0.whatever beta: a workflow to open an ssh session (using the default ssh: protocol handler) with "smart" hostname autocompletion (based on ~/.ssh/config, ~/.ssh/known_hosts, /etc/hosts, Bonjour or any file containing the names of hosts you need to connect to). Comments and suggestions welcome. Download v1.3 for Alfred 2 Download v2.3 for Alfred 3 Download v3.1 for Alfred 4 Download v4.0 for Alfred 5 Source and Issue Tracker on github Robin Updates 2013-03-14 00:00, v0.4: rudimentary fuzzy matching, to pull entries from /etc/hosts as well as ~/.ssh/known_hosts, and to deal with usernames properly. 2013-03-14 09:00, v0.5: smart host matching. 2013-03-14 22:45, v0.6: ~/.ssh/config and Bonjour discovery (including full BTMM support), and improved error handling. 2013-03-14 23:00, v0.61: explicitly removed 'broadcasthost' from the list of possible matches. 2013-03-15 00:30, v0.7: match '.' as '.' 2013-03-16 10:45, v0.8: refactored code and add tab autocompletion. 2013-03-16 13:30, v0.9: oops - the last update broke the workflow if you didn't have pybonjour installed; fixed. Continued refactoring: now using nikipore's alfred-python module. 2013-03-16 14:15, v0.10: further refactoring to break core functionality out into a dedicated module (enabling module compilation). Combined with caching of file parsing results this should deliver significantly enhanced performance (not that it was slow before). 2013-03-16 23:00, v1.0: complete refactoring and move release to github. New feature: display the source(s) of each suggested completion. This ought to be the last update for a while. 2013-03-16 08:40, v1.1: fixed breakage when either of ~/.ssh/config or ~/.ssh/known_hosts didn't exist. 2016-06-02 21:00, v1.3: fixed path to Alfred cache (thanks @okapi!). 2016-10-07 12:30, v2.0: The Alfred 3 Release (including removal of built-in sources and addition of custom sources) ... 2022-12-30 16:30, v4.0: The Alfred 5 Release (including removal of Bonjour source and switch to User Configuration)
×
×
  • Create New...