ngreenstein

Kill Process Workflow

25 posts in this topic

I made a workflow to kill processes quickly.

 

You can grab it (and read more about it) on GitHub.

Direct download link.

 

Here are some highlights:

  • Autocompletes process names
  • Learns and prioritizes processes you kill frequently
  • Shows icons when possible
  • Shows CPU usage
  • Shows process paths
  • Ignores case

Screenshot:

screenshot.png

Enjoy, and feel free to share any feedback you have.

Edited by ngreenstein

Share this post


Link to post

Very nice. I'd suggest though to pass the pid to args and kill using

kill -9 <pid>

This has less potential side effects.

Edited by nikipore

Share this post


Link to post

@ngreenstein: I mean that you might have several processes sharing a name; say you have three bash sessions, and only one of them hangs (CPU ~100%), would you want to kill'em all, or just the bad one?

ngreenstein likes this

Share this post


Link to post

Ok, @nikipore, I updated it to use `kill -9` by default. Feel free to re-download.

 

You can still kill all processes with matching names by actioning with command-return.

nikipore likes this

Share this post


Link to post

Cool for the kill -9 part, much safer now. The command-return part is very nice (the best of both worlds), but is broken for me (it shows up, but no action results).

ngreenstein likes this

Share this post


Link to post

Nope. My test case: Open Terminal.app, press Command-N twice. Then you have two processes named "bash". Kill one of them just pressing Enter (works). Kill the other two pressing Command-Enter (doesn't work).

Share this post


Link to post

Try with anything other than bash and let me know if it works for you. I think the problem is that bash has a hyphen at the beginning of the process name and killall is trying to interpret that as a flag (even though it's in quotes). Any ideas?

 

Thanks for your help with testing this!

nikipore likes this

Share this post


Link to post

Now I started two Python interpreters. Their process name is something like this (these are MacPort Python 2.6 interpreteres, just in case you wonder):

 

 8980 ttys001    0:00.02 /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python

 

And it doesn't work. I haven't looked into your code, but since youre identifying all processes correctly, why don't you pass all process IDs to the arg and put the row-specific pid in the first position? Then the scripts should pretty much look the same, except that one loops over all pids, and the other only picks the first one. No issues with weird names whatsoever.

Edited by nikipore

Share this post


Link to post

Ok, just pushed another update. Let me know if it changes anything.

 

It now works perfectly OMM for Python, bash, and every other process I've tried it with.

 

I don't have MacPorts to test with, but at this point I can't repro any issues.

 

Thanks for your help!

nikipore likes this

Share this post


Link to post

Debugged it and found the reason: Due to a hotkey conflict, the action wasn't triggered at all. Everything works perfectly now. Thanks!

Share this post


Link to post

awesome one! thanx

 

One thing, how about not requiring the query, and when there's no query, showing the top CPU consuming procceses, and then filtering by typed query?

Edited by altryne

Share this post


Link to post

I edited the icon to have a white border so that it's visible in the black. I figured I'd put it here for anyone that wants it.

 

Old:

6EUiaLc.png

 

New:

bxUwKb9.png

 

PNG here:

kGQ2Dqc.png

Share this post


Link to post

Good idea, thank you! Please submit a pull request on GitHub and I'll add this change.

 

I edited the icon to have a white border so that it's visible in the black. I figured I'd put it here for anyone that wants it.

 

Old:

6EUiaLc.png

 

New:

bxUwKb9.png

 

PNG here:

kGQ2Dqc.png

Share this post


Link to post

Can we please have an option to relaunch an app, not just kill it? For example if we hold the Shift key with "kill" the workflow can forcequit and relaunch the app, that would be very useful!

RuslanI likes this

Share this post


Link to post

Can we please have an option to relaunch an app, not just kill it? For example if we hold the Shift key with "kill" the workflow can forcequit and relaunch the app, that would be very useful!

 

Yes, this is quite good! 

Or have a special keyword for killing and relaunching. I'm OK with any option as long as there is such functionality. 

Share this post


Link to post

Can we please have an option to relaunch an app, not just kill it? For example if we hold the Shift key with "kill" the workflow can forcequit and relaunch the app, that would be very useful!

 

 

Yes, this is quite good! 

Or have a special keyword for killing and relaunching. I'm OK with any option as long as there is such functionality. 

 

That's a great idea! I'm afraid I don't have time to add this at the moment, but, if anyone feels up to it, they're more than welcome to submit a pull request on the GitHub repo. Thanks!

Share this post


Link to post

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 account

Sign in

Already have an account? Sign in here.


Sign In Now