This project manages context menu plugins to extend functionality in various directories. It allows dynamic addition and removal of context menu items using Python scripts.
- Plugin Development: Easily create plugins with metadata and functionality.
- Dynamic Menu Modification: Add or remove context menu items on the fly.
- Extensible: Customize and extend functionality by creating new plugins.
- Generate Plugin using AI: Generate a plugin using AI to automate the process.
- Drag and Drop: Drag and drop files to add plugins to the context menu.
- Configuration: Configure plugins with parameters to customize behavior.
- Customization: Customize the appearance of the application with themes.
First make sure you have Python 3.13.1 or above installed. If not, you can download it from here.
-
Clone the repository:
git clone https://github.com/abdbbdii/Context-Menu-Plugin-Manager.git
-
Go inside the repository:
cd Context-Menu-Plugin-Manager
-
Create a virtual environment
python -m venv .venv
-
Activate the virtual environment
.venv\Scripts\activate
-
Install the requirements
pip install -r requirements.txt
-
Run the program
python src/app.py
This is a template plugin to help you get started with creating your own plugins.
The driver
function receives two arguments:
items
: A list of strings representing the selected folders/files.params
: A JSON string containing the configuration parameters.
You can access the configuration parameters in the 'Configure Plugin' tab.
# Import the JSON module to work with JSON data
import json
"""
It receives a list of items and a JSON string as parameters.
It prints the items and the parameters to the console.
The `__name__ == "__main__"` block is for testing purposes only.
The `driver` function is the entry point for the Python script.
"""
# Only this line of code is required to create a plugin
def driver(items: list[str] = [], params: str = ""):
# Convert JSON string to dictionary
json_data = json.loads(params) if params else {}
print("Folders/Files:")
for item in items:
print(item)
print("Params:")
for key, value in json_data.items():
print(f"{key}: {value}")
# Keep the console open by waiting for user input
input("Press Enter to exit")
# For testing in the local directory (not executed when triggered as a plugin)
if __name__ == "__main__":
json_data: dict = {
"param1": "value1",
"param2": "value2",
}
string_data: str = json.dumps(json_data)
driver(["file1.txt", "file2.txt"], string_data)
This project is licensed under the BSD License.
Contributions are welcome! Feel free to open issues or submit pull requests to improve this project.
Big thanks to these awesome creators!
- @Flet Dev Community for the
flet
- A framework based on flutter for creating desktop applications. - @saleguas for the
context-menu
- A library to customize the context menu. - @Wanna-Pizza for the
FletDropZone
- A drag and drop feature forflet
.