dbus

Docker运行图形化程序

旧城冷巷雨未停 提交于 2019-12-10 11:42:23
 原理 Docker支持图形化程序,是利用Linux的X11技术。 相关文章 如何在Docker容器中启动D-Bus 引文详情 如何在Docker容器中启动D-Bus 翻译自 https://georgik.rocks/how-to-start-d-bus-in-docker-container/ 很多Linux应用需要用到 D-Bus, 但它在Docker容器中默认并不存在 当你尝试启动这类应用时,你会收到一个错误信息: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/var/lib/dbus/machine-id": No such file or directory See the manual page for dbus-uuidgen to correct this issue. D-Bus not built with -rdynamic so unable to print a backtrace Aborted 首先你需要通过下面命令生成缺失的 machine-id(译者注:我一般是直接在容器启动时挂载host上的machine-id): dbus-uuidgen > /var/lib/dbus/machine-id 这样以来

systemd service not starting using dbus interface

天大地大妈咪最大 提交于 2019-12-10 10:35:07
问题 I am trying to start systemd service usnig dbus service. I am following the example 5 of below mentioned link: http://www.freedesktop.org/software/systemd/man/systemd.service.html My dbus service is: [D-BUS Service] Name=com.native.Test_Dbus_060 Exec=/usr/sbin/server_060 User=apps StandardOutput=tty TTYPath=/dev/ttyS0 SystemdService=com.native.Test_Dbus_060.service my systemd com.native.Test_Dbus_060.service is: [Unit] Description=dbus test server [Service] Type=dbus BusName=com.native.Test

How do I get the currently playing song in Rhythmbox using Python

谁说胖子不能爱 提交于 2019-12-09 18:40:40
问题 Im using Ubuntu 12.04. I want to access Rhythymbox using Python . This is how I've proceeded so far: Ive gone through this site https://live.gnome.org/RhythmboxPlugins/WritingGuide , but it gives details on how to write plugins , which Im not interested in right now. Ive gone through a few tutorials which tells me to do this. import dbus session_bus = dbus.SessionBus() proxy_obj = session_bus.get_object( 'org.gnome.Rhythmbox', '/org/gnome/Rhythmbox/Player') But I am getting the following

dbus-python 指南

馋奶兔 提交于 2019-12-09 11:41:19
本文系转载,原文出处: 原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。 http://fanrenhao.blog.51cto.com/3961213/807935 This tutorial requires Python 2.4 or up, and dbus-python 0.80rc4 or up. 指南需要:Python 2.4 或更高的版本, dbus-python 0,80rc4或更高的版本 Connecting to the Bus (连接Bus) Making method calls (制造一个方法调用) Proxy objects (代理对像) interfaces and methods (接口和方法) See also Data types (数据类型) Basic types (基本类型) Basic type conversions (基本类型约定) Container types (容器类型) Return values , and the byte_arrays and utf8_strings options (返回值, byte_arrays 和 utf8_strings 选项) Making asynchronous method calls (使用异步方法调用) Setting up

DBUS ARM 移植

自闭症网瘾萝莉.ら 提交于 2019-12-09 11:38:42
dbus-1.5.0.tar.gz expat-2.2.0.tar.bz2 DBUS移植 ./configure --host=arm-linux-gnueabihf --prefix=/opt/rootnfs/dbusdev/expat-2.2.0/expatInstall ./configure --host=arm-linux-gnueabihf --prefix=/opt/rootnfs/dbusdev/dbus-1.5.0/dbusInstall CFLAGS=-I/opt/rootnfs/dbusdev/expat-2.2.0/expatInstall/include LDFLAGS=-L/opt/rootnfs/dbusdev/expat-2.2.0/expatInstall/lib ARM端 export LD_LIBRARY_PATH=/tmp/dbusdev/expat-2.2.0/expatInstall/lib:/tmp/dbusdev/dbus-1.5.0/dbusInstall/lib:$LD_LIBRARY_PATH ./dbus-daemon --config-file=../etc/dbus-1/system.conf --print-address ./dbus-daemon --config-file=../etc/dbus-1/session

Simple C or C++ API for controlling systemd services

时间秒杀一切 提交于 2019-12-08 16:31:55
问题 Goal I'd like to write C/C++ applications and provide an API for them to communicate directly with systemd -managed services. Effectively, I'd like my applications to be able to do the equivalent of systemctl start service_name@unit_number.service without using system() , popen() , or exec() calls ( hard requirement ). Question Is there a simple C/C++ API for communicating with systemd , assuming systemd version 219 (i.e. CentOS v7.4, also a hard requirement )? Work So Far I've scoured online

How do I register a profile with bluez using dbus/gio?

为君一笑 提交于 2019-12-08 11:25:57
问题 I'm trying to register a profile with bluez through D-Bus/Gio. When I call RegisterProfile everything goes OK. I check my GError and it's NULL and my return value is an empty GVariant. I've tried many things, but here is my latest code. When I run it, it prints "g_dbus_connection_call_sync succeeded", but I can't see my new profile in D-Bus using d-feet and I cannot connect to it using a my test device. I know the code on the test device works, or at least did work with straight bluez, but I

How to use dbus-send to call org.bluez.Adapter1.StartDiscovery?

淺唱寂寞╮ 提交于 2019-12-08 08:17:51
问题 I am trying to interact with Bluez 5.44 using the dbus-send command line tool. I cannot seem to get it to start discovery properly, although it works fine when I use bluetoothctl 's scan on and scan off commands. I can also start and stop discovery using d-feet . I've tried powering off and on prior to issuing the command, but it doesn't seem to get discovery started. The command line I'm using is: dbus-send --system --type=method_call --print-reply --dest=org.bluez \ /org/bluez/hci0 \ org

can't get dbus signal listener to work in C with gnome multimedia keys

点点圈 提交于 2019-12-08 05:58:06
问题 I'm trying to make my own application that will listen to the media-keys in gnome using dbus. I have found a script that works in python and I'm trying to make it work by converting it to C. My c-code builds and runs correctly but it doesn't respond to the dbus signal. this python code works: #!/usr/bin/env python """Printing out gnome multi media keys via dbus-python. """ import gobject import dbus import dbus.service import dbus.mainloop.glib def on_mediakey(comes_from, what): """ gets

How to use dbus-send to call org.bluez.Adapter1.StartDiscovery?

谁说我不能喝 提交于 2019-12-08 03:29:31
I am trying to interact with Bluez 5.44 using the dbus-send command line tool. I cannot seem to get it to start discovery properly, although it works fine when I use bluetoothctl 's scan on and scan off commands. I can also start and stop discovery using d-feet . I've tried powering off and on prior to issuing the command, but it doesn't seem to get discovery started. The command line I'm using is: dbus-send --system --type=method_call --print-reply --dest=org.bluez \ /org/bluez/hci0 \ org.bluez.Adapter1.StartDiscovery What I usually get upon issuing this command is from dbus-monitor is that