{"id":13572475,"url":"https://github.com/zhaocai/alfred2-top-workflow","last_synced_at":"2025-04-06T10:14:34.855Z","repository":{"id":7491231,"uuid":"8840281","full_name":"zhaocai/alfred2-top-workflow","owner":"zhaocai","description":"Alfred 2 Workflow: 1) Top Processes Based Memory, CPU, and IO Usage; 2) Get a Glance of System Status","archived":false,"fork":false,"pushed_at":"2016-07-03T20:21:07.000Z","size":12101,"stargazers_count":521,"open_issues_count":11,"forks_count":36,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-03-30T09:09:33.240Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://zhaocai.github.com/alfred2-top-workflow/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhaocai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-17T19:33:10.000Z","updated_at":"2025-03-23T14:36:59.000Z","dependencies_parsed_at":"2022-08-06T20:01:16.721Z","dependency_job_id":null,"html_url":"https://github.com/zhaocai/alfred2-top-workflow","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhaocai%2Falfred2-top-workflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhaocai%2Falfred2-top-workflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhaocai%2Falfred2-top-workflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhaocai%2Falfred2-top-workflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhaocai","download_url":"https://codeload.github.com/zhaocai/alfred2-top-workflow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247464226,"owners_count":20942970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T14:01:24.253Z","updated_at":"2025-04-06T10:14:34.824Z","avatar_url":"https://github.com/zhaocai.png","language":"Ruby","funding_links":[],"categories":["Ruby","Utility"],"sub_categories":[],"readme":"# Alfred 2 Top Process Workflow\n\nThe initial motive of this workflow is to avoid frequent visits to the Activity Monitor when the fan goes loud. Now it has been evolved with two major features:\n\n- 1) List/Kill Top Processes by Memory/CPU/IO Usage\n\n![](https://raw.github.com/zhaocai/alfred2-top-workflow/master/screenshots/mixed%20top%20processes.png) \n\n\n- 2) (*working in progress*) Get a glance of system status including internal battery, fan speed, CPU/GPU Temperature, bluetooth battery, disk capacity, etc.\n\n![](https://raw.github.com/zhaocai/alfred2-top-workflow/master/screenshots/glance.png) \n\n## Usage\n\n### 0. Show Help \n\nJust type `-?`, `-h`, or `--help` after the keyword to show help.\n\n![](https://raw.github.com/zhaocai/alfred2-top-workflow/master/screenshots/help.png) \n\n### 1. Top Processes\n\n#### A. Keywords:\n\n##### 1.) `top`: Show a mixed processes list based on top cpu/memory usage.\n\n\n###### 1. `top -m`, `top --memory` to show processes ranked by memory usage\n\n###### 2. `top -c`, `top --cpu`, to show processes ranked by cpu usage\n\n###### 3. `top -i`, `top --io`, to show processes ranked by io usage with **callback** from top io trace collector.\n\n   Top IO requires [DTrace][Dtrace] and it would take a while to finish. The new **callback** design is to run the job in he background and post a notification (OSX 10.8+) using notification center. Click on the notification to show the result in alfred.\n\n![](https://raw.github.com/zhaocai/alfred2-top-workflow/master/screenshots/callback.png) \n\n\n\n\n###### **Modifier Key**\n\n   - `none`    : The default action is to list files opened by process ID\n   - `control` : Kill the selected process\n   - `command` : kill forcefully (`kill -9`)\n   - `alt`     : Nice (lower) the selected process's cpu priority\n   - `shift`   : Search web for process information\n\n\n##### 2.) `kill`: Filter process to kill.\n\n###### **Modifier Key**\n\n   - `none`: The default action is to kill by process ID\n   - `command` : kill forcefully (`kill -9`)\n\n##### 3.) `lsof`: List files opened by process id\n\n###### **Modifier Key**\n\n   - `none`: The default action is to reveal file in Finder\n\n#### B. Filter by Query\n\n##### 1.) Type process name to filter\n\n![](https://raw.github.com/zhaocai/alfred2-top-workflow/master/screenshots/filtered%20by%20query.png)\n\n##### 2.) To search for process state, use **:idle**, **:sleep**, **:stopped**, **:zombie**, **:uninterruptible**, **:runnable**, etc.\n\n![](https://raw.github.com/zhaocai/alfred2-top-workflow/master/screenshots/top%20sleep.png) \n\n\n### 2. Glance an Eye on your system\n\n#### A. Keywords:\n\n1. `glance`: Show system information including internal battery, bluetooth battery, disk capacity, etc.\n\n![](https://raw.github.com/zhaocai/alfred2-top-workflow/master/screenshots/battery.png)\n\n#### B. Change Display Order\n\n1. Activate `Alfred Preferences` → `Advanced` → `Top Result Keyword Latching`\n\n    ![](https://raw.github.com/zhaocai/alfred2-top-workflow/master/screenshots/Alfred_Preferences_Learning.png)\n\n2. Hit `Enter` for the feedback item you wish to show up on the top.\n\n\n\n## Installation\n\nTwo ways are provided:\n\n1. You can download the [Top Processes.alfredworkflow](https://github.com/zhaocai/alfred2-top-workflow/raw/master/Top%20Processes.alfredworkflow) and import to Alfred 2. This method is suitable for **regular users**.\n\n2. You can `git clone` or `fork` this repository and use `rake install` and `rake uninstall` to install. Check `rake -T` for available tasks.\nThis method create a symlink to the alfred workflow directory: \"~/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows\". This method is suitable for **developers**.\n\n\n## Troubleshooting\n\n### 1. Does not work in Mac OSX 10.9 (Maverick)\n\nIn OSX 10.9, the system ruby is upgraded to 2.0.0. You need to download the new version of this workflow which packs the ruby gems for 2.0.0 inside.\n\nIf the downloaded version does not work, try \n\n1.) open `Terminal.app`. If you use rvm or rbenv, switch to the system ruby.\n2. run `cd \"$HOME/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/me.zhaowu.top\" \u0026\u0026 rake bundle:update`\n\n\n### 2. iotop causes mouse lagging\n\nThis issue is not caused by this workflow but by [DTrace][DTrace]. The related system log message is `IOHIDSystem cursor update overdue. Resending.`.\nIn my Macbook Pro, any [DTrace][DTrace] based program will introduce this issue including the mac built-in `/usr/bin/iotop`, and `/Applications/Xcode.app/Contents/Applications/Instruments.app` .\n\nI upgrade to OS X 10.9 and this issue is resolved.\n\n### 3. Encoding::CompatibilityError: incompatible character encodings: ASCII-8BIT and UTF-8\n\nAdd the following contents to `/etc/launchd.conf`. Restart is required.\n```sh\nsetenv LANG en_US.UTF-8\nsetenv LC_ALL en_US.UTF-8\n```\n\n\n## Copyright\n\nCopyright (c) 2013 Zhao Cai \u003ccaizhaoff@gmail.com\u003e\n\nThis program is free software: you can redistribute it and/or modify it under\nthe terms of the GNU General Public License as published by the Free Software\nFoundation, either version 3 of the License, or (at your option)\nany later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT\nANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\nFOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with\nthis program. If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n\n\n\n[DTrace]: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/dtrace.1.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhaocai%2Falfred2-top-workflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhaocai%2Falfred2-top-workflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhaocai%2Falfred2-top-workflow/lists"}