Skip to content

Commit 5fd789f

Browse files
author
Hörmet Yiltiz
committed
add steps
1 parent 6189639 commit 5fd789f

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

CONTRIBUTING.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,44 @@
1313
* Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
1414
* Changes that do not add anything substantial to the stability, functionality, or testability will generally not be accepted.
1515

16+
### Steps
17+
18+
- Set up the paprent repo which provides dev environment and exposes Python APIs:
19+
20+
git clone --recursive https://github.com/albertlauncher/albert.git
21+
cd albert
22+
cmake -B build -S . -DCMAKE_INSTALL_PREFIX=~/.local/ -DCMAKE_BUILD_TYPE=Debug
23+
cmake --build build
24+
cmake --install build
25+
26+
- The above also clones Albert python plugins repo as a git submodule under `albert/plugins/python/plugins/`. Refer to the (official API)[https://albertlauncher.github.io/reference/namespacealbert.html] for the class definitions. Read the stub file `plugins/python/albert.pyi` which describes the classes commonly used in albert python plugins; this file also provides completion and type hints for your editor/IDE.
27+
28+
- Fork the official albert python plugins repo in Github web page: https://github.com/albertlauncher/python. Then create your new plugin folder following:
29+
30+
cd albert/plugins/python/plugins/
31+
git add remote mine https://github.com/<github-handle>/albert-plugins-python
32+
mkdir my_plugin
33+
cat <<EOF > __init__.py
34+
import albert
35+
36+
md_iid = '2.4'
37+
md_version = '1.0'
38+
md_name = 'My Plugin'
39+
md_description = 'Does fancy things'
40+
41+
class Plugin(albert.PluginInstance):
42+
pass
43+
EOF
44+
python3 -m venv .venv
45+
source .venv/bin/activate
46+
47+
- Go to the root repo `albert` containing `pyproject.Test your project to ensure it works.
48+
49+
- Rename your project to better describe it. Once you are finished, create a pull request:
50+
51+
git add my_awesome_new_plugin
52+
git commit
53+
git push mine main
54+
# now go to your Github fork page to create a PR to the Albert python plugins repo
55+
1656
Thanks! :heart:

0 commit comments

Comments
 (0)