Allow desc sorting and listing without filter#13
Allow desc sorting and listing without filter#13yannickglt wants to merge 1 commit intongreenstein:masterfrom
Conversation
|
Hi @ngreenstein! Is it possible to merge this pull request? |
|
Hi @yannickglt, and thanks for this! Unfortunately, I don't have access to a copy of Alfred 3 to test this on (just 2), nor do I have a reliable Internet connection at the moment. I would love to merge this in the future, but, in the meantime, I encourage anyone who wishes to to download from this branch. Thanks again! |
|
It's OK! Thanks for your answer. I guess we can wait a bit more to get it merged 😉 |
|
You can download Alfred Process Killer with sorting here |
|
I just updated it and it's working very well for me! Great work guys 👍 |
devnoname120
left a comment
There was a problem hiding this comment.
Minor comments, make sure to update the workflow binary after the changes.
| end | ||
| # Assemble this item's XML string for Alfred. See http://www.alfredforum.com/topic/5-generating-feedback-in-workflows/ | ||
| thisXmlString = "\t<item uid=\"#{processName}\" arg=\"#{processId}\"> | ||
| thisXmlString = "\t<item arg=\"#{processId}\"> |
There was a problem hiding this comment.
Make this configurable.
Also don't remove the uid but instead conditionally use skipknowledge to show the most killed processes before that the user starts typing a process name.
| # The -A flag shows all processes. The -o pid, -o %cpu, and -o comm show only the process's PID, CPU usage and path, respectively. | ||
| # Grep for processes whose name contains the query. The regex isolates the name by only searching characters after the last slash in the path. | ||
| # The -i flag ignores case. | ||
| processes = `ps -A -o pid -o %cpu -o comm | grep -i [^/]*#{Regexp.quote(theQuery)}[^/]*$`.split("\n") |
There was a problem hiding this comment.
What would you think about using the dedicated GNU tool for that?
- awk 'NR>1'
+ sort -n +2
awk 'NR>1') without having to type a piece of process name.awk 'NR>1'pipe remove the headers (PID %CPU COMM) and fix issue when displaying all elements or filtering on words containing "PID", "CPU", etc. (probably issue Stuck on "Finding processes..." #11)sort -nrk 2,2pipe sorts results on the second column descending: CPU.uidattribute is mandatory to get sorting working. If an UID is present on an element in the XML response, then Alfred will remember it and suggest it in the top ranked results if the user selected it in the past.Closes #10, #11