{"id":20597218,"url":"https://github.com/cathive/fx-dbus","last_synced_at":"2026-04-17T23:02:05.242Z","repository":{"id":9806843,"uuid":"11787291","full_name":"cathive/fx-dbus","owner":"cathive","description":"Easy integration of D-Bus into your Java / JavaFX applications.","archived":false,"fork":false,"pushed_at":"2013-10-08T07:55:21.000Z","size":180,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-17T01:08:11.994Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"evgenyrodionov/redux-logger","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cathive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-31T09:21:55.000Z","updated_at":"2019-09-28T07:16:29.000Z","dependencies_parsed_at":"2022-09-05T05:40:31.500Z","dependency_job_id":null,"html_url":"https://github.com/cathive/fx-dbus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cathive%2Ffx-dbus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cathive%2Ffx-dbus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cathive%2Ffx-dbus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cathive%2Ffx-dbus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cathive","download_url":"https://codeload.github.com/cathive/fx-dbus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242231441,"owners_count":20093636,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T08:21:11.621Z","updated_at":"2026-04-17T23:02:00.194Z","avatar_url":"https://github.com/cathive.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"D-Bus integration for Java and JavaFX\n=====================================\n\n\nIntroduction\n------------\n\nThis library provides an easy way to integrate D-Bus into\nyour Java / JavaFX applications.\n\n\nHighlights\n----------\n\n*   Native bindings to libdbus-1 via BridJ (no need to install any native libraries)\n*   Nice object-oriented API\n*   Supported platforms: Linux and Mac OS X, possibly others (untested)\n\n\nRequirements\n------------\n\n*   libdbus-1 library\n*   Running D-Bus instance\n*   Oracle Java SE 7 Runtime (possibly OpenJDK 7 works, haven't tested)\n\nUsually every modern Linux distribution should meet the first of the two requirements mentioned above.\n\n\nFeatures\n--------\n\nBelow you'll find a list of already existing features as well as features that are planned for\nfuture releases:\n\n- [x] Bindings to the C-API of D-Bus (libdbus-1) about 75% done\n- [x] Support for synchronous calls\n- [x] Support for all known basic types\n- [ ] Support for asynchronous calls\n- [ ] Nice JavaFX API using Workers, Services, Callbacks and Properties\n- [ ] Annotation-based method bindings\n- [ ] Support for structures and arrays\n\n\nExample Usage\n-------------\n\nThe Java code below shows how to use the gnome-screenshot tool via D-Bus:\n\n```java\nfinal String destination = \"org.gnome.Shell.Screenshot\";\nfinal String path = \"/org/gnome/Shell/Screenshot\";\nfinal String iface = \"org.gnome.Shell.Screenshot\";\n\n// Filename that shall be used to store the screenshot.\nfinal String filename = File.createTempFile(\"screenshot\", \".png\").getAbsolutepath();\n\n// Initializes the D-Bus library correctly.\nDBus.initialize();\n\n// Fetches a new (private) D-Bus connection.\nfinal Connection connection = Connection.getConnection(BusType.SESSION, true);\n\n// Call \"SelectArea()\" and use the result to call \"ScreenshotArea()\"\nfinal Message area = connection.sendWithReply(Message.newMethodCall(destination, path, iface, \"SelectArea\"));\nif (area != null \u0026\u0026 !area.isError()) {\n    final Message ssRequest = Message.newMethodCall(destination, path, iface, \"ScreenshotArea\");\n    for (final MethodArgument\u003c?\u003e arg: area) {\n        ssRequest.addArguments(arg);\n    }\n    ssRequest.addArguments(booleanParam(true), stringParam(filename));\n    final Message ssResponse = connection.sendWithReply(ssRequest);\n    if (ssResponse != null \u0026\u0026 !ssResponse.isError()) {\n        final Iterator\u003cMethodArgument\u003c?\u003e\u003e ssParam = ssResponse.iterator();\n        if (ssParam.next().get().equals(Boolean.TRUE)) {\n            System.out.println(\"Successfully saved screenshot to \" + ssParam.next().get());\n        }\n    }\n}\n\n// Close the D-Bus connection.\nconnection.close();\n\n// Cleanly shutdown dbus.\nDBus.shutdown();\n```\n\nCreation of the API\n-------------------\n\nI analyzed the output of JNAerator and came to the conclusion\nthat it woul take a bit more work to make sure, that the\nnative mappings would work the way I wanted them them.\n\n```sh\n# Command line used to create the initial mappings.\n# I threw away everything and started from scratch\n# once I figured out that I was not really satisfied\n# with the resulting API.\njava -jar jnaerator.jar \\\n-I/usr/include/dbus-1.0 -I/usr/include \\\n-package org.freedesktop.dbus \\\n-library dbus \\\n-mode Directory \\\n-beautifyNames \\\n-direct \\\n-runtime BridJ \\\n/usr/include/dbus-1.0/dbus/dbus.h\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcathive%2Ffx-dbus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcathive%2Ffx-dbus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcathive%2Ffx-dbus/lists"}