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
krunnerdbusutils-0.1.2.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for krunnerdbusutils-0.1.2-py3-none-any.whl
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | 8028d82c1e1c3f74ad0ef4820eeeaf7f873c1f3f0fcb5a8b625152fb3f5ef293 |
|
| MD5 | 30363037a0c44748591618d0b60c28b8 |
|
| BLAKE2b-256 | 2c295792ef67a49ec4dd21dd19269eaa7f881ee40cb3d426eefcaad115d21b4b |