Skip to main content

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


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)

Uploaded Source

Built Distribution

krunnerdbusutils-0.1.2-py3-none-any.whl (4.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page