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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

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

Hashes for krunnerdbusutils-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1425a8684ee62bb4222946c1eb5b732be06b1b049db116d033f644afb411c8fc
MD5 61795b806d7f530f47446fbc556fce33
BLAKE2b-256 b9996740ec280fe09404a5007c96b64607abbc2a2d1593f9ad3d9842958e8834

See more details on using hashes here.

File details

Details for the file krunnerdbusutils-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for krunnerdbusutils-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8028d82c1e1c3f74ad0ef4820eeeaf7f873c1f3f0fcb5a8b625152fb3f5ef293
MD5 30363037a0c44748591618d0b60c28b8
BLAKE2b-256 2c295792ef67a49ec4dd21dd19269eaa7f881ee40cb3d426eefcaad115d21b4b

See more details on using hashes here.

Supported by

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