什么程序在 GNOME 2 和 GNOME 3 中启动每个用户会话 dbus-daemon 进程(大概是通过 dbus-launch)?我想知道,因为我想在 dbus-daemon 检查 .service 文件的目录列表中添加一个目录。
(显然,如果它是一个 sh 程序,“sh”不是我正在寻找的答案;-)
我怎么能有效地为自己回答这个问题?桌面和会话启动有哪些文档?
我尝试使用 dbus 和 UPower 挂起我的服务器。服务器运行 Ubuntu LucidLynx 64 位。
如果我直接坐在机器前,一切正常,但无法通过 ssh 运行。如果我通过 ssh 连接到服务器并尝试使用 dbus 和 upower 挂起机器,它会返回
dbus.exceptions.DBusException: org.freedesktop.UPower.GeneralError: 未授权
谁能告诉我如何配置 dbus 以允许 ssh-users 挂起机器?
Banshee 能够使用以下命令从命令行控制其主窗口
$ banshee --next
Run Code Online (Sandbox Code Playgroud)
但是,当以同一用户身份通过 ssh 运行这些命令时,它只是尝试启动 banshee。
当使用 ssh 会话登录时,有没有办法推送到另一个会话。
我猜这更像是 ssh/tty 的事情而不是女妖的事情,但如果可以做到的话,我很想知道。
编辑:
export $(strings /proc/*/environ| grep DBUS_SESSION | tail -1)
Run Code Online (Sandbox Code Playgroud)
似乎适用于我的用例。请注意,有很多权限被拒绝的输出,但您可以忽略它。
通过:http : //machine-cycle.blogspot.com/2010/12/ssh-and-dbus-sessions.html
如果有人有更清洁的修复程序,我会很乐意看到它。
作为一个强迫性的计算机用户,我整天都在它面前。当我在做我的伴奏时,我有时会忘记时间。我需要一个通知服务来提醒我当前时间,通过弹出通知或正在播放的声音或两者兼而有之。
对于弹出窗口,我找到了使用DBus API的免费桌面通知标准。
我能够使用图形 DBUS 浏览器DFeet创建通知。我使用了以下参数:
"wakeup", 1234, "", "The time is", "9PM", [], [], 1
Run Code Online (Sandbox Code Playgroud)
到目前为止它工作正常,但我怎么能从这里走得更远呢?
cron仍然自动基于时间行动的建议呢?一个完整的解决方案将不胜感激,也许对其他人也有用。
我在以字典格式(字符串,变体)传递函数的参数时遇到问题;我尝试在 gnome 中运行截屏视频并启动我需要传递这些参数的功能:
-method name="Screencast"-
-arg type="s" direction="in" name="file_template"/-
-arg type="a{sv}" direction="in" name="options"/-
-arg type="b" direction="in" name="flash"/-
-arg type="b" direction="out" name="success"/-
-arg type="s" direction="out" name="filename_used"/-
-/method-
Run Code Online (Sandbox Code Playgroud)
这是我的电话:
~$ gdbus call --session --dest org.gnome.Shell.Screencast --object-path /org/gnome/Shell/Screencast --method org.gnome.Shell.Screencast.Screencast "test_ %d_ %t.webm" {dict:string:variant:"draw-cursor",true,"framerate",35,pipeline,"vp8enc min_quantizer=13 max_quantizer=13 cpu-used=5 deadline=1000000 threads=%T ! queue ! webmmux"}
Run Code Online (Sandbox Code Playgroud)
这是错误输出:“a{sv}”:0-33:无法解析为“a{sv}”类型的值。错误在语法中?谢谢
我正在尝试在 Ubuntu 12.04 上安装 bluez 5.2 库。在运行时./configure,我收到 GLib2.0 的错误,我可以通过使用sudo apt get-installGLib2来解决。现在我收到错误"configure: error: D-Bus >= 1.6 is required"。我已经下载并安装了 DBUS 1.8.6。但我仍然收到同样的错误。当签入/etc文件夹时,我仍然找到 dbus-1。有没有安装错误?
我正在尝试在 Ubuntu PC 上使用蓝牙耳机。我可以通过BT将手机连接到PC。我可以将音乐流式传输到 PC。但听不到通话音频。我查看了Android手机日志,BT sco链接已经建立。但是在拨打电话或虚拟电话时(在 Android 手机中通过 sco 路径播放音频),PC 耳机中听不到音频。SCO 数据包也不会出现在 btmon 日志中。有没有人成功做到这一点?
version- ubuntu 16.04
Installed- bluez, ofono, pulseaudio
pactl sink: Name- bluez_sink.22_22_8E_DE_B9_2B,
Name: alsa_output.pci-0000_00_1b.0.iec958-stereo
pactl source: Name-bluez_sink.22_22_8E_DE_B9_2B.monitor
Name: alsa_input.pci-0000_00_1b.0.analog-stereo
Run Code Online (Sandbox Code Playgroud) 我找到了两个工作版本,可以将我的笔记本正确挂起到 RAM。
$ dbus-send --system --print-reply \
--dest=org.freedesktop.login1 /org/freedesktop/login1 \
"org.freedesktop.login1.Manager.Suspend" boolean:true
Run Code Online (Sandbox Code Playgroud)
和
$ systemctl suspend
Run Code Online (Sandbox Code Playgroud)
以上哪个是要使用的,它们之间有什么区别?
我想运行一个 docker 容器,它将能够systemctl在其主机上运行命令。
在这个问题之后,我没有找到适合我的解决方案。
我对 docker 基本映像没有硬性限制,因此对 ubuntu-16.04 主机使用 ubuntu-16.04 docker 映像,对 ubuntu-18.04 主机使用 ubuntu-18.04 docker 映像是完全可以接受的。
为了notify-osd在 Linux (Ubuntu) 上拦截 ( ) 通知,我使用了dbus-monitor下面的脚本。随后,脚本运行另一个脚本 ( /opt/nonotifs/nonotifs/silent),并将截获的通知作为参数,以进行进一步处理:
#!/bin/bash
dbus-monitor "interface='org.freedesktop.Notifications'" | \
grep --line-buffered "string" | \
grep --line-buffered -e method -e ":" -e '""' -e urgency -e notify -v | \
grep --line-buffered '.*(?=string)|(?<=string).*' -oPi | \
grep --line-buffered -v '^\s*$' | \
xargs -I '{}' /opt/nonotifs/nonotifs/silent {}
Run Code Online (Sandbox Code Playgroud)
这完美无缺,除了通知hplip。
从终端运行时,上面的脚本显示:
xargs: unmatched double quote; by default quotes are special to xargs unless you use the -0 option
Run Code Online (Sandbox Code Playgroud)
-0 …
dbus ×10
bluetooth ×2
ssh ×2
systemd ×2
12.04 ×1
banshee ×1
bash ×1
bluez ×1
command-line ×1
compiling ×1
docker ×1
gnome ×1
notification ×1
pulseaudio ×1
screencast ×1
scripts ×1
session ×1
suspend ×1
xargs ×1