Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
210 changes: 105 additions & 105 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,106 +1,106 @@
__pycache__
*.py[cod]
*$py.class

# Distribution / packaging
.Python build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
*.manifest
*.spec

# Log files
pip-log.txt
pip-delete-this-directory.txt
*.log

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
.pytest_cache/
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Translations
*.mo
*.pot

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pyflow
__pypackages__/

# Environment
.env
.venv
env/
venv/
ENV/

# If you are using PyCharm #
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/gradle.xml
.idea/**/libraries
*.iws /out/

# Sublime Text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
*.sublime-workspace
*.sublime-project

# sftp configuration file
sftp-config.json

# Package control specific files Package
Control.last-run
Control.ca-list
Control.ca-bundle
Control.system-ca-bundle
GitHub.sublime-settings

# Visual Studio Code #
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
__pycache__
*.py[cod]
*$py.class
# Distribution / packaging
.Python build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
*.manifest
*.spec
# Log files
pip-log.txt
pip-delete-this-directory.txt
*.log
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
.pytest_cache/
nosetests.xml
coverage.xml
*.cover
.hypothesis/
# Translations
*.mo
*.pot
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# pyflow
__pypackages__/
# Environment
.env
.venv
env/
venv/
ENV/
# If you are using PyCharm #
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/gradle.xml
.idea/**/libraries
*.iws /out/
# Sublime Text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
*.sublime-workspace
*.sublime-project
# sftp configuration file
sftp-config.json
# Package control specific files Package
Control.last-run
Control.ca-list
Control.ca-bundle
Control.system-ca-bundle
GitHub.sublime-settings
# Visual Studio Code #
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history
30 changes: 15 additions & 15 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"args": ["vmmem"]
}
]
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"args": ["vmmem"]
}
]
}
12 changes: 6 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"python.testing.promptToConfigure": false,
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false,
"python.pythonPath": ".venv\\Scripts\\python.exe"
{
"python.testing.promptToConfigure": false,
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false,
"python.pythonPath": ".venv\\Scripts\\python.exe"
}
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# Task Killer #

## Introduction ##
This project was inspired as a workaround for terminating the `vmmem` process at a regular interval in order to prevent it from interrupting unrelated workflows. The gist is that when working under WSL, the Linux side of the house attempts to take dominion of instance memory it doesn't necessarily need. This presents a problem when doing things that are memory intensive. When this happens, the memory is no longer available to Windows, but it's exposed via the `vmmem` task in Task Manager. Unfortunately, this task cannot be shutdown from Windows as its technically not owned by Windows, but it CAN be shutdown via the `wsl --shutdown` command in the terminal. Enter **Task Killer**, the solution that allows for automating this shutdown task, along with any standard task you just want killed when other programs are running. Simply put, when Task Killer finds a defined, no longer needed program running against a list of other programs, it kills it. In addition, this can be automated with the Windows Task Scheduler and the included batch file.


## Prerequisites ##
- Python 3
- Windows
## Getting Started ##

- Define what programs you want evaluated by editing the `PROGRAMS_LIST` in the `constants.py` file. A sample list is left there for reference.
- In the root of the project create a Python virtual environment in a directory named `.venv` by pasting the command in the terminal:
``` python -m venv .venv ```
- Install dependencies by running:
``` pip install -r requirements.txt```

- Run the file in the terminal and pass the process you want terminated as an argument:
``` python task_killer.py <process name here> ```






# Task Killer #
## Introduction ##
This project was inspired as a workaround for terminating the `vmmem` process at a regular interval in order to prevent it from interrupting unrelated workflows. The gist is that when working under WSL, the Linux side of the house attempts to take dominion of instance memory it doesn't necessarily need. This presents a problem when doing things that are memory intensive. When this happens, the memory is no longer available to Windows, but it's exposed via the `vmmem` task in Task Manager. Unfortunately, this task cannot be shutdown from Windows as its technically not owned by Windows, but it CAN be shutdown via the `wsl --shutdown` command in the terminal. Enter **Task Killer**, the solution that allows for automating this shutdown task, along with any standard task you just want killed when other programs are running. Simply put, when Task Killer finds a defined, no longer needed program running against a list of other programs, it kills it. In addition, this can be automated with the Windows Task Scheduler and the included batch file.
## Prerequisites ##
- Python 3
- Windows
## Getting Started ##
- Define what programs you want evaluated by editing the `PROGRAMS_LIST` in the `constants.py` file. A sample list is left there for reference.
- In the root of the project create a Python virtual environment in a directory named `.venv` by pasting the command in the terminal:
``` python -m venv .venv ```
- Install dependencies by running:
``` pip install -r requirements.txt```
- Run the file in the terminal and pass the process you want terminated as an argument:
``` python task_killer.py <process name here> ```
6 changes: 3 additions & 3 deletions constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env python

PROGRAMS_LIST = ["Overwatch.exe", "r5apex.exe", "GameOverlayUI.exe", "starwarsbattlefrontii.exe"]
#!/usr/bin/env python
PROGRAMS_LIST = ["Hades.exe","Overwatch.exe", "r5apex.exe", "GameOverlayUI.exe", "starwarsbattlefrontii.exe"]