Terminal Posted January 12, 2020 Posted January 12, 2020 (edited) Alfred-Man This workflow was inspired by Unix man page workflow A Unix man page search workflow that supports opening it with the default application (Terminal.app, iTerm2.app), Generating a PDF or HTML and opening them with your default application. PDF and HTML files are generated once when you request them, and then are updated if you open them and their timestamp is 30 day or older. Features Fast PDF, Terminal, HTML Support Auto Update, Thanks deanishe Usage Keyword: ;man Enter defaults to opening in terminal CMD + Enter opens as PDF Option + Enter opens as HTML Updates Version 1.2.1 - Resolved a issue where random symbols weren't stripped from the description. Thanks @gingerbeardman for reporting this issue. Version 1.2.0 - Moved pdf/html storage to the workflow cache directory Download Github Repo Direct Download Notes PDF and HTML file update mechanisms may be revisited to determine a better solution. Right now, they are generated and then kept in the workflow directory. Perhaps they should use the cache directory. Looking to add searching just as Unix man workflow. Such as section specific searches. Edited January 16, 2020 by Terminal cands 1
vitor Posted January 15, 2020 Posted January 15, 2020 On 1/12/2020 at 4:23 AM, Terminal said: Right now, they are generated and then kept in the workflow directory. Perhaps they should use the cache directory. The definitely should. You could also make a case for having them in the Workflow’s Data directory (though I’d consider the Cache more appropriate), but the Workflow’s directory is the wrong place as it will sync with the Workflow, taking up more space in the user’s sync solution and getting overwritten when upgrading the Workflow.
Terminal Posted January 15, 2020 Author Posted January 15, 2020 5 minutes ago, vitor said: The definitely should. You could also make a case for having them in the Workflow’s Data directory (though I’d consider the Cache more appropriate), but the Workflow’s directory is the wrong place as it will sync with the Workflow, taking up more space in the user’s sync solution and getting overwritten when upgrading the Workflow. you are completely correct. I’ll have to see if awgo supports retrieving the cache directory. Else I’ll need to figure out a way.
vitor Posted January 15, 2020 Posted January 15, 2020 Just now, Terminal said: I’ll have to see if awgo supports retrieving the cache directory. I would bet a body part that it does. @deanishe cares about correctness and that’s too important a detail to leave out. Terminal and deanishe 1 1
Terminal Posted January 15, 2020 Author Posted January 15, 2020 35 minutes ago, vitor said: I would bet a body part that it does. @deanishe cares about correctness and that’s too important a detail to leave out. sure does have that function. Working on a update now. Along with a few that fixes.
deanishe Posted January 15, 2020 Posted January 15, 2020 10 hours ago, vitor said: I would bet a body part that it does Congratulations, you have won a body part! The rump is very good, sir. Terminal, xilopaint and vitor 3
Terminal Posted January 15, 2020 Author Posted January 15, 2020 I've pushed a new release with these changes!
gingerbeardman Posted January 15, 2020 Posted January 15, 2020 (edited) I've just switched to this workflow from the one you were inspired by. So far working great, thanks! What annoyed me about the old workflow was that every so often it would reindex, and of course you only notice those several seconds when you are in a hurry to look something up and it takes me out of my work zone. I wonder if it's possible to present the Man page in a Quicklook panel? I usually go with the Terminal approach, but it's not ideal in that it often clutters up my terminal session. I don't like HTML and PDF for similar reasons, and moreso because their apps are even slower to open than Terminal. Edited January 15, 2020 by gingerbeardman
gingerbeardman Posted January 15, 2020 Posted January 15, 2020 (edited) Some command have strange output obscuring their description, see. automation_trampoline(8) I also dislike the icon, it's too busy. But I'll just paste over my own choice. Edited January 15, 2020 by gingerbeardman
gingerbeardman Posted January 15, 2020 Posted January 15, 2020 (edited) Here's the icon I am using, I claim no ownership so anybody is free to use it. Edited January 15, 2020 by gingerbeardman
Terminal Posted January 15, 2020 Author Posted January 15, 2020 20 minutes ago, gingerbeardman said: I've just switched to this workflow from the one you were inspired by. So far working great, thanks! What annoyed me about the old workflow was that every so often it would reindex, and of course you only notice those several seconds when you are in a hurry to look something up and it takes me out of my work zone. I wonder if it's possible to present the Man page in a Quicklook panel? I usually go with the Terminal approach, but it's not ideal in that it often clutters up my terminal session. I don't like HTML and PDF for similar reasons, and moreso because their apps are even slower to open than Terminal. 18 minutes ago, gingerbeardman said: Some command have strange output obscuring their description, see. automation_trampoline(8) I also dislike the icon, it's too busy. But I'll just paste over my own choice. 9 minutes ago, gingerbeardman said: Here's the icon I am using, I claim no ownership. This is all very valuable feedback. Expect update to resolve these issues within a day. Thankfully, this workflow will auto update! As for your quick look question, that’s an idea. I’ll research it and see if I can get it working !
deanishe Posted January 15, 2020 Posted January 15, 2020 13 minutes ago, gingerbeardman said: I wonder if it's possible to present the Man page in a Quicklook panel? That would require a Quicklook plugin that handles troff (the format man pages are written in). The only realistic alternative, AFAIK, is for the workflow to start an HTTP server that generates the HTML versions on demand.
Terminal Posted January 15, 2020 Author Posted January 15, 2020 6 minutes ago, deanishe said: That would require a Quicklook plugin that handles troff (the format man pages are written in). The only realistic alternative, AFAIK, is for the workflow to start an HTTP server that generates the HTML versions on demand. Currently I do generate a html file and then it’s cached for 30 days. I could make the cache time configurable, but it is already able to build on demand the. Open in a default browser. hmmm solutions solutions.
deanishe Posted January 15, 2020 Posted January 15, 2020 2 minutes ago, Terminal said: Currently I do generate a html file and then it’s cached for 30 days. The problem is that the Quicklook feature relies on the quicklookurl or arg field of each feedback item (i.e. Alfred doesn't call your code again to get the Quicklook version). So you either need to generate the HTML versions in advance before returning the results, or point quicklookurl at a local webserver that can generate them on demand (or load a cached version). I used the webserver approach to generate previews of events in my Google Calendar workflow. If you decide to go that route, you might be able to crib something useful from that workflow. The preview server shuts itself down after 60s without a request.
Terminal Posted January 16, 2020 Author Posted January 16, 2020 1 hour ago, deanishe said: The problem is that the Quicklook feature relies on the quicklookurl or arg field of each feedback item (i.e. Alfred doesn't call your code again to get the Quicklook version). So you either need to generate the HTML versions in advance before returning the results, or point quicklookurl at a local webserver that can generate them on demand (or load a cached version). I used the webserver approach to generate previews of events in my Google Calendar workflow. If you decide to go that route, you might be able to crib something useful from that workflow. The preview server shuts itself down after 60s without a request. Ah I was misunderstanding you. I’ll have a look! Thanks!
Terminal Posted January 16, 2020 Author Posted January 16, 2020 4 hours ago, gingerbeardman said: Some command have strange output obscuring their description, see. automation_trampoline(8) I also dislike the icon, it's too busy. But I'll just paste over my own choice. Funny thing is that is shows up with a man command. So it wasn't the workflow it's self. Anyway, using a regex pattern that strings all random chars from the beginning and end of the descriptions. And since its caching, I didn't notice a noticeable impact on performance. You can either type man workflow:update to trigger the update and then man workflow:delcache to rebuild your cache, or just wait for them to trigger themselves. man -k -P cat . | grep automation_trampoline attach_automation_image(8), -(8) - ."====================== attach_automation_image attach and initialize disk images for automation_trampoline(8) ." ." automation_trampoline(8), -(8) - ."====================== automation_trampoline runs automation on boot ." ." ." ." makewhatis: /usr/lib/./libgutenprint.2.dylib: No such file or directory gingerbeardman 1
gingerbeardman Posted January 20, 2020 Posted January 20, 2020 Thanks! Also, feel free to use the icon I posted.
gingerbeardman Posted June 9, 2022 Posted June 9, 2022 Any chance to get a new version of this where the binary is Universal M1+Intel? I'm trying to delay installing Rosetta2 (to run Intel apps) for as long as possible.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now