A utility library for interacting with the KRunner API via D-Bus
Project description
krunnerdbusutils
Utilities for writing a KRunner plugin using python.
Usage example:
from krunnerdbusutils import krunner_actions, krunner_match, krunner_run, \
AbstractRunner, Action, Match, run_event_loop
class Runner(AbstractRunner):
def __init__(self):
super().__init__("net.fancyplugin2", "/fancyplugin")
@krunner_match
def Match(self, query: str):
matches = []
if query == "hello":
match = Match() # Or utilize keyword constructor
match.id = "hello_match"
match.text = "Hello There!"
match.subtext = "Example"
match.icon = "planetkde"
matches.append(match)
return matches
@krunner_actions
def Actions(self):
return [Action(id="id", text="Action Tooltip", icon="planetkde")]
@krunner_run
def Run(self, data: str, action_id: str):
print(data, action_id)
if __name__ == "__main__":
run_event_loop(Runner)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file krunnerdbusutils-0.1.2.tar.gz.
File metadata
- Download URL: krunnerdbusutils-0.1.2.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1425a8684ee62bb4222946c1eb5b732be06b1b049db116d033f644afb411c8fc
|
|
| MD5 |
61795b806d7f530f47446fbc556fce33
|
|
| BLAKE2b-256 |
b9996740ec280fe09404a5007c96b64607abbc2a2d1593f9ad3d9842958e8834
|
File details
Details for the file krunnerdbusutils-0.1.2-py3-none-any.whl.
File metadata
- Download URL: krunnerdbusutils-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8028d82c1e1c3f74ad0ef4820eeeaf7f873c1f3f0fcb5a8b625152fb3f5ef293
|
|
| MD5 |
30363037a0c44748591618d0b60c28b8
|
|
| BLAKE2b-256 |
2c295792ef67a49ec4dd21dd19269eaa7f881ee40cb3d426eefcaad115d21b4b
|