如何找出哪个应用程序与指示图标相关联?

如何找出哪个应用程序与指示图标相关联?

在 Ubuntu 10.04 中执行此操作很简单。该问题特定于 Ubuntu 12.04。

使用 dbus 的组合,其实现细节如下跟进由于某种原因失踪,所以另一个自我创作了回答(解释了这个琐碎但有点费力的过程这里)。

回复关于gdbus是有用的,但是这个回答非常有用 - (静态系统开销现已减少到可接受的~10%)。

一些相关参考资料
(来源:回答指示器和系统托盘有什么区别?
以下是指标的文档:

应用程序指标 | Ubuntu 应用程序开发者
libindicate 参考手册
libappindicator 参考手册

參考文獻:如何识别制作指示图标的应用程序?(此链接错误地重定向至https://askubuntu.com/questions/184589/how-can-menu-bars-that-require-a-right-click-be-activated-like-ubuntu-versions
书签:如何找出 Ubuntu 12.04 中哪个应用程序与指示图标相关联?
是一个严重的问题,原因和问题如下所述,并且已经投入了大量资金,并且对于补救目的是必要的。


审查参考资料以找到一个协调的解决方案......
(可能需要一个指标)


这与右键单击无关(是吗?)。

Ubuntu 12.04 中的指示器图标如何与负责在顶部面板上显示它的程序相匹配?

正在运行的应用程序列表可以包括所有使用 的进程System Monitor

如何找到一个指标的正确匹配过程?

如何识别子指标应用程序?这些是与指标下拉菜单的组件相关联的应用程序。(这本来是一个单独的问题,很自然地会跟进进展。它包含在这里,因为很明显,没有规定可以轻松追踪违规的子应用程序或指标应用程序。)

(对 SM 的检查指出了导致电池更快耗尽和运行时间缩短的一个相当明显的因素 - 12.04 中的环境静态 CPU 率现在远远超过 20%,而之前在 10.04 中,它远低于 10%,在 5% 到 7% 之间! - 巨大的过度 CPU 开销源自 Xorg 和 compiz - 启动系统后,只运行 SM 并选择所有进程,按 %CPU 排序 - 在资源和进程之间切换分析执行开销问题 - 运行另一个应用程序(如 gedit“文本编辑器”)会短暂地给予它 CPU 优先级 - 返回 S&M 几个应用程序。按顺序位于列表顶部:gnome-system-monitor 正如预期的那样,然后是:Xorg、compiz、unity-panel-service、hud-service,dbus-daemon 和 kworker/x:y 与一些预期的守护进程和后台任务(如 nm-applet)混合在一起 - Xorg 和 compiz 不仅需要过多的 CPU 时间,而且它们的随行人员也必须一起来!进一步加剧了问题 - 我们的计算密集型任务在现场不再有效 - 电池寿命缩短,自定义应用程序的 CPU 时间减少等 - 所有这些都源于对电池应用程序指示器的检查 - 这不是一个轻率、夸张或无聊的思考,而是对 12.04 的可靠部署产生了影响,以减少其在生产环境中的开销的负面影响)

(我对电池指示器有疑问 - 它有时显示 %,有时显示 hh:mm - 需要了解 ap。和 v。才能获得更多有关控制的信息。同样:其他指示器 aps 也存在问题:NM 与 iwlist/iwconfig 冲突、BT ap。与 RF 开关、电池 ap。没有挂起/睡眠功能,导致电池运行时间较短,... 还有很多)

详情来自:
如何找到应用程序指标 ID?

建议查看:
file:///usr/share/indicator-application/ordering-override.keyfile

[Ordering Index Overrides]
nm-applet=1
gnome-power-manager=2
ibus=3
gst-keyboard-xkb=4
gsd-keyboard-xkb=5

这解决了电池 ap。识别问题,并且大概 nm 是 rf 图标的 NetworkManager,但是信封、蓝牙和扬声器指示器 aps。仍然是个谜。(此外,顺序不相关。)

请注意,过去只需右键单击即可获得About查找 ap. 和 v. 信息的选项。

浏览周围内容:

文件:///usr/share/indicator-application/ordering-override.keyfile

检查:
file:///usr/share/indicators
file:///usr/share/indicators/messages/applications/
...

也许?/大概?所需信息可能隐藏在
file:///usr/share/indicators 中

评论中提到:
指示器和系统托盘有什么区别?
引用该来源...

不幸的是,桌面指标尚未得到很好的记录:我找不到任何规范文档......

嗯...实际文件
https://wiki.ubuntu.com/DesktopExperienceTeam/ApplicationIndicators#Summary
虽然没有太大帮助,但它的存在信息提供了相当多的见解......

答案1

应用程序指示器服务具有内部 API,允许获取所有指示器的列表,其中包括其 DBus 地址。您可以使用以下命令行执行此操作:

gdbus call --session --dest com.canonical.indicator.application --object-path /com/canonical/indicator/application/service --method com.canonical.indicator.application.service.GetApplications

您将得到一些不太有用的东西,因为它是伪 JSON 格式。如果您编写脚本,您可以将其拉入解析器并使用它。如果您只对执行一次感到好奇,只需阅读文本即可。您正在寻找一个像这样的字段::1.XXX 这是指示器的 DBus 地址。

获得指示器的地址后,您可以询问 DBus 该指示器的 PID 是什么。您可以:1.123像这样请求 PID:

gdbus call --session --dest org.freedesktop.DBus --object-path / --method org.freedesktop.DBus.GetConnectionUnixProcessID :1.123

获得 PID 后,您可以询问/proc有关该进程的信息。例如,如果您想知道用于启动进程号的命令,1您可以执行以下操作:

cat /proc/1/cmndline

祝你好运!

答案2

第 1 次迭代

qdbus --literal   com.canonical.AppMenu.Registrar                  \
                 /com/canonical/Unity/Panel/Service                \
                  com.canonical.Unity.Panel.Service.Sync           \
| sed -e 's/[^{]*{\(.*\)}\]/\1/' | sed -e 's/\[[^"]*/[/g'          \
| sed -e 's/\[\(\(\("[^"]*"\|[^,"]*\), \)\{4\}\)[^]]*,\([^,]*\)\]/[\4, \1]/g' \
| sed -e 's/\[\([^,]*\, \)\("[^"]*",\)/[    \1\2                  /g'  \
| sed -e 's/\[ *\(....,.\{24\}\) */[\1/g'  | sed -e 's/\], \[/]\n[/g'  | sort -n -k2

生产:

[  -1, "libprintersmenu.so",  "", "", "", ]
[   0, "libappmenu.so",       "0x9581b90", "", "_File", ]
[   1, "libappmenu.so",       "0x9582ad0", "", "_Edit", ]
[   2, "libappmenu.so",       "0x9583cf0", "", "_View", ]
[   3, "libappmenu.so",       "0x9585828", "", "_Search", ]
[   4, "libappmenu.so",       "0x9586da8", "", "_Tools", ]
[   5, "libappmenu.so",       "0x96575a0", "", "_Documents", ]
[   6, "libappmenu.so",       "0x96596e0", "", "_Help", ]
[ 200, "libmessaging.so",     "0x9238c7c", "indicator-messages", "", ]
[ 250, "libpower.so",         "0x9346c54", "indicator-power", "", ]
[ 300, "libapplication.so",   "0x86a6368", "bluetooth-manager", "", ]
[ 450, "libapplication.so",   "0x930f650", "nm-applet", "", ]
[ 500, "libsoundmenu.so",     "0x9346cac", "indicator-sound", "", ]
[ 550, "libdatetime.so",      "0x931581c", "indicator-datetime", " 4:59:07 PM", ]
[ 600, "libsession.so",       "0x92ed45c", "indicator-session-devices", "", ]

第二次迭代

(带确认关联的图标)

qdbus --literal   com.canonical.AppMenu.Registrar                  \
                 /com/canonical/Unity/Panel/Service                \
                  com.canonical.Unity.Panel.Service.Sync           \
| sed -e 's/[^{]*{\(.*\)}\]/\1/' | sed -e 's/\[[^"]*/[/g'          \
| sed -e 's/\[\(\(\("[^"]*"\|[^,"]*\), \)\{4\}\)\([^,]*, \)\{3\}\("[^"]*"\)[^]]*,\([^,]*\)\]/[\6, \1 <\5>]/g' \
| sed -e 's/<"">\]/]/g'  | sed -e 's/<"\([^"]*">\]\)/<img src="data:image\/png;base64,\1/g'    \
| sed -e 's/\], \[/<\/td><\/tr>\n<tr><td>/g'  | sort -n -k2 | sed -e 's/, /<\/td><td>/g'        \
| sed -e 's/\[/<html><table>\n<tr><td>/' | sed -e 's/\]/<\/td><\/tr>\n<\/table><\/html>/' >hapi.html

生产:

hapi.png

这是 hapi.html(不含单元格黑色背景):

<tr><td> -1</td><td>"libprintersmenu.so"</td><td>""</td><td>""</td><td>""</td><td> </td></tr>   /*  oops  */
<html><table>
<tr><td> 0</td><td>"libappmenu.so"</td><td>"0x8b12b38"</td><td>""</td><td>"_File"</td><td> </td></tr>
<tr><td> 1</td><td>"libappmenu.so"</td><td>"0x8a1cd30"</td><td>""</td><td>"_Edit"</td><td> </td></tr>
<tr><td> 2</td><td>"libappmenu.so"</td><td>"0x8b01b28"</td><td>""</td><td>"_View"</td><td> </td></tr>
<tr><td> 3</td><td>"libappmenu.so"</td><td>"0x8b35700"</td><td>""</td><td>"_Search"</td><td> </td></tr>
<tr><td> 4</td><td>"libappmenu.so"</td><td>"0x8b11350"</td><td>""</td><td>"_Terminal"</td><td> </td></tr>
<tr><td> 5</td><td>"libappmenu.so"</td><td>"0x8b142f0"</td><td>""</td><td>"Ta_bs"</td><td> </td></tr>
<tr><td> 6</td><td>"libappmenu.so"</td><td>"0x8b37528"</td><td>""</td><td>"_Help"</td><td> </td></tr>
<tr><td> 200</td><td>"libmessaging.so"  </td><td>"0x85c8c7c"</td><td>"indicator-messages"   </td><td>""</td><td> <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABHNCSVQICAgIfAhkiAAAAd9JREFUOI3t0UFP02AcBvDnfRvMSDzwBUy2CpZwwCN6Mc4FE8iQs9/BCzOytWxzm4EYMWEQMMHExE+gF+JxnuwYRtcWNlrcIurttRuY7WLCeD0V6+iE4cmEJ2nS9/n3/0ubAuf5b0Ocm92KkeEcUQAXzmj9BMFioH84CgDUaTnnSqlsrtXre9vdirVafbtUNt/wQz7ldPT3mAii6B9MpWYV9t02TosyZusPU7MxUfRLhJAeDxjo9fmGstknsWR6TrHtk3HGbF1OpOWlxXml1+cbcs9o+8OU0pGVpadxOfHorzhjth6dScaeP8smKKUjxxyvJYHSa6vLC8q0kpK9cMZsfSoiT79YXX4gCMJ1L8MTBoBms3kxErm3lc48ju/v/7Ccvl7bKyczczNy/H6p0Wj0ddo/yudPBneuwrucFgrdDFctbb1qaevB4I077/NvjT/6Hf1DeOz2xIaaK7p3O8IFNaePjgbHK5aWd7qKWVQlSbolSVKwYhbVo97SPk6GxyYKak5vh4kbBgBrp/pyoD9wiVIaOvEzAbRarfyXr992xYD/LgAEBoZJG6wfAEQ4DdYpnPMD8crVHsD184zN8ivOcfgPbMvY3HrtnIhrMgjgclvXlQygCsA8+8udp5v8AnS3+yjTJl0RAAAAAElFTkSuQmCC"></td></tr>
<tr><td> 250</td><td>"libpower.so"      </td><td>"0x86da454"</td><td>"indicator-power"      </td><td>""</td><td> <img src="data:image/png;base64,. GThemedIcon battery-charged battery-full-charged-symbolic battery-full-charged gpm-battery-charged gpm-battery-100-charging "></td></tr>
<tr><td> 300</td><td>"libapplication.so"</td><td>"0x86a6368"</td><td>"bluetooth-manager"    </td><td>""</td><td> <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAWCAYAAAAW5GZjAAAABHNCSVQICAgIfAhkiAAAAchJREFUKJHNkc9LVFEUx7/3YUJF5EhgM6+GoBiEaNEy8g8ogihI2rSXYDIQNxW0EHEROdIsJkwEJ19kDWXRrjSKBgNzHO4d6um7b7xji9RZyFNxMVPvnjYpPXSyRYu+y3M+fL/nB/B/SjlipuTyW9v1jC0VhhgR61aycGNnGKTfZycGAeqplbCpOYd/N00z9jwz/FhJoZXkVwPOSoqEcvkZACAisizr64PBoUS1Ul354eubAdjzvOOk8bLkFM4BoKamfaHUvUSKGUZdMnm/OxBtmuapieybyTmHV4qzvFp0+JS082vxeNs1APu3LBqJRFo+ZscmlRTk2vn19njbdQAN211Dp9Ppwt49u+sBgBnGrtZLF74B8H6HGQDMz4uQX6FxX/tHGYz6crkswuGDJxljl48cOzEacPYr+gmRbh4YSHdprf2unju3FxaXuNZ6pOSKs4GBRzNWX2dHeweARsfOrQ7394ej0WjLTOFTuTjLFza4OgC42HolCWAFwDIAagyF6N3Yq/OMsQOvx9/erfE/wPmS86SdSygpdCrZ2wfgUE3YtfPrSgrKjDy0AByuCQLA9NSHzy+ePXoKIPZH8JdOA2j+G/Df6SfH0s58lIXOZQAAAABJRU5ErkJggg=="></td></tr>
<tr><td> 450</td><td>"libapplication.so"</td><td>"0x869f258"</td><td>"nm-applet"            </td><td>""</td><td> <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABHNCSVQICAgIfAhkiAAAAvJJREFUOI3tkk9sVFUUxn/n3XmP6WBk/gBCojDTMJPSocNURJSV2qW6EKIkBaRRE5WYsCAahJCMbtREjEkTEzHRhmJFYnRhZGFMmhIWTUmpxVJDZpipmbSdMm1RoH2vnb53XTA11NSWrQm/3T0n35fvnHPhPv9bZLFiNptd4fPsmChvPaJCrqv9BlgAKGPGc+dmDNGTniEjjmMOJZPJ2SWNi8Ur4YrtbTPE26hFDIDKTGV22rFtd9atAChLmYHAyhrTVBaA1tozxJfXKnApFov9ucA4k8kYLXtfSAOPahFjfHxisr9vYLTtq/byhZ6eaWAO8KoaA/A1NTUFDjTvWlu/Jbk+EgmHRIurtdEbjdf3i4gWgKFc/zMa2XTr1tTUF1+2DbS2fl4CpgC7UCiYWt9OaI2lPNd1DXOitra+KCIKqAEC7x8/8vCePbuTln+FX/Cy0U3pTgEY6O/eXSpdnznwypu/Dg8Pl4cGB8NYbrPWulkgpcH3rxXe1JqLhkhHBf938Xi8kk7XPfTpiU8aIpFQTUP6ybPzO14HVDKZzI2X9+06aGg+0PCA57n2WHl8oDQ6VnAcx1bKp4LBVeE1qyPRYHBVQkR8CKN4HI0lUqeAMHdClBYcL5/9bb+gTzm2ff2Xzq6vT3zcen6oWBwB/qru2QD8wIONjakNh946+NTOJ7a/ZFpmUDR7o4lUx7zXghHPfHM2X7c5ceadd9/ryOVyfedOn765+fGGZ0XkaY1s0KLnxGNYoOuHn74/1/LqG92PNTb+fOzY4Rd/H7xa+M/vBgSAR4Brf2SvJDzcH4FaFidvoJ7fGE/mgBhQBKYXTVxtXAUolcfS4VAw0nupr729/duuzvNdZaUsY8eO7aHXX2tpSm/d8tzkjfE0MDivWSrx3awDUkAeGAHsat1fnSoKXAZKi4mXMv6HQvbyh8Dbd176o1h869HlNOpejH2WMusS8Z2O40ycPNn2WXfPxWvLae4pMbAS2AZooJe7jnSfZfkbe1wfX9DFYSoAAAAASUVORK5CYII="></td></tr>
<tr><td> 500</td><td>"libsoundmenu.so"  </td><td>"0x86da4ac"</td><td>"indicator-sound"      </td><td>""</td><td> <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAWCAYAAADafVyIAAAABHNCSVQICAgIfAhkiAAAAudJREFUSIntkF1ok1cYx38njTW1rSkOZGjFK52fbKCCzsgWkIF4sV0IAxljIIiyi+mFCOLdwJuJn5tuQ7AVh1VX2Vjpqq6aZc5araZ5bWOak7dvl5W1YtOPtE1i3o+zC410Npoh1St/V+c8zzn/3zkPvOZVYEjtdyOunVRKuZ7uTSq8CP39900Unxmx9u1TkQdAT1z7skdqnwP4fKvfj3a0Depd4ZSut3knnnvmD/rD4XIjrgUNqQUK9dPjmQ0Kjuh6u+/atRt/trTerHW5RKWTc20pKlBKudIefkCxDnhPqXMlAIYMb++Wdz8A+O5E7RFQysra+wDzZG3d947j5EzT3FxU0KN3HBAu8WF+HwhEBIBp2rtQTn0iemfO4aPHfurru3+7tHTa2kT0zpxgMCiTyWSHx+N5W0o5fZKgO6b9ZkhNGVJTKPVFIfGVwB91QoiKtGV/AqT+SvReAlypdHY9YI2OjXcKIdy58eElhX7gLxQ6kWis6xxAOpNZCWA6uRDAWDq9CMAyzV6AgcGBec8d0bOIROISQCBmA1SWlQ8CWLZVCSBEyQiAbVtVLyQ4dGjfTIBMNpMC8FbN8gJksw9HATye0hkAIyOj2UmCZDIZKSZQtrXh0dnBKEBlxYxlAAPJ4e5HAs+bAGOZ8b78HXd+sWqNfyvwBsCvDfXbFr21YOPTglL39L22bWUaG5ouAFSUl3/kOE6usakxCFBW5lnuOI5VU1P35LHuCfdb8otNH3+aaGr4saq6eu7aiYLW1ps/9yQSyeMnakKGDK8GsaL3n77rp06dNXS9zYvlXjk0NHyvubl5qNg0xNKFC323Wq7ebbsRiADicX0+MBtARkPt3THN3rN752YAGQntMKSmzp+p+apYeJ4SYA3wbqHmxcYLp7/9+uBBwPt3Z+eseDT0IHbvdsrv9y/9v4JiLAbmAehd7fWG1NTxbw7s579jnxo6Qi2dVy//cgWonvLwx/iAd15W+HP5F1PVVGkwY49EAAAAAElFTkSuQmCC"></td></tr>
<tr><td> 550</td><td>"libdatetime.so"   </td><td>"0x86a581c"</td><td>"indicator-datetime"   </td><td>" 5:25:55 PM"</td><td> </td></tr>
<tr><td> 600</td><td>"libsession.so"    </td><td>"0x867cc5c"</td><td>"indicator-session-devices"</td><td>""</td><td> <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABHNCSVQICAgIfAhkiAAAAlZJREFUOI3tlE9IVFEUxr/z/tgkKBHpJhEkRF4LV1GOIC2yRcxEEmGLJHAIhXCjCzdu3BVBC3VTi9rr2iwt9Q0ElTmO8yZtnOv4JKHIHi7m5XvlDJ4WOTA8549uow/u4p7znd89F869wH8dV6Yw2BQGH9UvFQomEokqIZZqyhWvr8dqE4lE1ZHAQojqCun3tMSKLkSsblPEQ16PmTS6hYjVSfvQVfr1SghRXRacTEYrHcepkQjnFdAmg58daofwXAFtEpHmum5tMhmtLAsOBDp3+geGBpk5C0B2XPe71+O47jYAmZmz/QNDg4FA505ZMIC9sZGH9USkOLvO1zt37/V6Dd3d93udXecbESmjIw/qAOwdBQxmdAHAm/nwk+Xl+JQ3vxCJTM3Nh58CAIO6CjGU/I13nCLRpXEAGQBoaGy+nn+r2NKniWDw2vBJn+9irq6hsZlKdpxTS8vlH3nbyYMFAGhrb98uVetVEEAw8iG8agqDP8cXbhYzrsYXbpvC4MX3+mquLj/v7XgSwGQqtfESABRVeWSa0VNe6NbKyukKVX0MAKnUxgvvbQqBAQBzs2/HmTmryMo5zsgfzXWj4+9rFNUbInYrq2YNWZbPMnM2rL+bKMQgb2BtbfGMSuosETUzY5+o6OTsE0FiZiPDmStNTReskh3regTptC3Z9s8voZ6+0PTr2THLsoxc3rIsY2ZmbjTU0xeybXsrnbZJ1yOFzj4kRdO0q62tl24A8AGoB+DP+938BzFfW5u/Q9O0dnjGtiQcQEV+oMi3eeI40GI6NFL/lv4A7ogQZ4Yx+nYAAAAASUVORK5CYII="></td></tr>
</table></html>

确认:[crud] 是图标图像数据,符合data:image/png;base64,[crud]

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAWCAYAAADafVyIAAAABHNCSVQICAgIfAhkiAAAAudJREFUSIntkF1ok1cYx38njTW1rSkOZGjFK52fbKCCzsgWkIF4sV0IAxljIIiyi+mFCOLdwJuJn5tuQ7AVh1VX2Vjpqq6aZc5araZ5bWOak7dvl5W1YtOPtE1i3o+zC410Npoh1St/V+c8zzn/3zkPvOZVYEjtdyOunVRKuZ7uTSq8CP39900Unxmx9u1TkQdAT1z7skdqnwP4fKvfj3a0Depd4ZSut3knnnvmD/rD4XIjrgUNqQUK9dPjmQ0Kjuh6u+/atRt/trTerHW5RKWTc20pKlBKudIefkCxDnhPqXMlAIYMb++Wdz8A+O5E7RFQysra+wDzZG3d947j5EzT3FxU0KN3HBAu8WF+HwhEBIBp2rtQTn0iemfO4aPHfurru3+7tHTa2kT0zpxgMCiTyWSHx+N5W0o5fZKgO6b9ZkhNGVJTKPVFIfGVwB91QoiKtGV/AqT+SvReAlypdHY9YI2OjXcKIdy58eElhX7gLxQ6kWis6xxAOpNZCWA6uRDAWDq9CMAyzV6AgcGBec8d0bOIROISQCBmA1SWlQ8CWLZVCSBEyQiAbVtVLyQ4dGjfTIBMNpMC8FbN8gJksw9HATye0hkAIyOj2UmCZDIZKSZQtrXh0dnBKEBlxYxlAAPJ4e5HAs+bAGOZ8b78HXd+sWqNfyvwBsCvDfXbFr21YOPTglL39L22bWUaG5ouAFSUl3/kOE6usakxCFBW5lnuOI5VU1P35LHuCfdb8otNH3+aaGr4saq6eu7aiYLW1ps/9yQSyeMnakKGDK8GsaL3n77rp06dNXS9zYvlXjk0NHyvubl5qNg0xNKFC323Wq7ebbsRiADicX0+MBtARkPt3THN3rN752YAGQntMKSmzp+p+apYeJ4SYA3wbqHmxcYLp7/9+uBBwPt3Z+eseDT0IHbvdsrv9y/9v4JiLAbmAehd7fWG1NTxbw7s579jnxo6Qi2dVy//cgWonvLwx/iAd15W+HP5F1PVVGkwY49EAAAAAElFTkSuQmCC

答案3

很遗憾 -

gdbus call --session --dest com.canonical.indicator.application                \
             --object-path /com/canonical/indicator/application/service        \
                   --method com.canonical.indicator.application.service.GetApplications

没有详尽列举所有指示器图标或其子指示器。MI(消息指示器)菜单接口与几个子指示器通信应用程序未列出。还缺少电源、音量和时钟指示器信息。

qdbus使用更简单,并d-feet提供 GUI 来执行相同操作,以及轻松列出属性值。

使用qdbus方法如下:

qdbus  --literal | sort

com.canonical.indicator.application在输出中三次单击选择w/ nl

...  
:1.97  
:1.98  
 ca.desrt.dconf  
 com.canonical.AppMenu.Registrar  
 com.canonical.hud  
 com.canonical.indicator.application  
 com.canonical.indicator.datetime  
 com.canonical.indicator.messages  
 com.canonical.indicator.printers
 com.canonical.indicator.session
 com.canonical.indicator.sound
 com.canonical.Unity
 ...  

bash history使用向上箭头重复命令(删除| sort 只留下)编写下一个命令qdbus --literal,然后按鼠标中键完成命令:

qdbus  --literal  com.canonical.indicator.application

三次单击最后一行

/
/org
/org/ayatana
/org/ayatana/indicator
/org/ayatana/indicator/service
/com
/com/canonical
/com/canonical/indicator
/com/canonical/indicator/application
/com/canonical/indicator/application/service

按下重复历史向上箭头、空格键和鼠标中键来编写:

qdbus  --literal  com.canonical.indicator.application  /com/canonical/indicator/application/service

双击在输出中选择所需的方法,然后按向上箭头、空格键和鼠标中键来创建命令,再按回车键运行它。(在此示例中为清楚起见添加了 \ 行继续):

qdbus  --literal  com.canonical.indicator.application                \
                 /com/canonical/indicator/application/service        \
                  com.canonical.indicator.application.service.GetApplications

这输出仅有的BT 和 NM 指示信息(此处打印出来以方便说明)

[Argument: a(sisossssss)
  {[Argument: (sisossssss)
    "bluetooth-active", 
    0, 
    ":1.155",
    [ObjectPath: /org/ayatana/NotificationItem/bluetooth_manager/Menu],
    "",
    "",
    "",
    "Bluetooth: On",
    "bluetooth-manager",
    "Bluetooth"],
    [Argument: (sisossssss) 
    "nm-signal-75", 
    1, 
    ":1.21", 
    [ObjectPath: /org/ayatana/NotificationItem/nm_applet/Menu], 
    "", 
    "", 
    "", 
    "Wireless network connection 'office WiFi 1' active: office WiFi (77%)", 
    "nm-applet", 
    "Network"]
  }
]

其他指示器被称为其他com.canonical.indicator. ...接口(在开始处列出),然而这可能是必须使用的,但子菜单指示器 aps 仍然未被识别:

qdbus --literal   com.canonical.AppMenu.Registrar               \
                 /com/canonical/Unity/Panel/Service             \
                  com.canonical.Unity.Panel.Service.Sync

尽管存在许多垃圾内容(可能是图标图像位),但修剪和美化后的输出是:

[Argument: a(ssssbbusbbi) {
[Argument: (ssssbbusbbi) "libappmenu.so", "0x9733fe0", "", "_File", true, true, 0, "", false, false, 0],
[Argument: (ssssbbusbbi) "libappmenu.so", "0x97352e0", "", "_Edit", true, true, 0, "", false, false, 1],
[Argument: (ssssbbusbbi) "libappmenu.so", "0x9737868", "", "_View", true, true, 0, "", false, false, 2],
[Argument: (ssssbbusbbi) "libappmenu.so", "0x9738920", "", "_Search", true, true, 0, "", false, false, 3],
[Argument: (ssssbbusbbi) "libappmenu.so", "0x9739e10", "", "_Terminal", true, true, 0, "", false, false, 4],
[Argument: (ssssbbusbbi) "libappmenu.so", "0x973c070", "", "Ta_bs", true, false, 0, "", false, false, 5],
[Argument: (ssssbbusbbi) "libappmenu.so", "0x973d6a0", "", "_Help", true, true, 0, "", false, false, 6],
[Argument: (ssssbbusbbi) "libapplication.so", "0x90cdcd0", "bluetooth-manager",  "", false, false, 1, "<... crud ...>", true, true, 300],
[Argument: (ssssbbusbbi) "libapplication.so", "0x8e861a8", "nm-applet",          "", false, false, 1, "<... crud ...>", true, true, 450],
[Argument: (ssssbbusbbi) "libprintersmenu.so", "", "", "", false, false, 0, "", false, false, -1],
[Argument: (ssssbbusbbi) "libmessaging.so",   "0x8dabc7c", "indicator-messages", "", false, false, 1, "<... crud ...>", true, true, 200],
[Argument: (ssssbbusbbi) "libpower.so",       "0x8f0405c", "indicator-power",    "", true, false, 6,
   ". GThemedIcon battery-charged battery-full-charged-symbolic battery-full-charged gpm-battery-charged gpm-battery-100-charging ", true, true, 250],
[Argument: (ssssbbusbbi) "libsoundmenu.so",   "0x8f040b4", "indicator-sound",    "", false, false, 1, "<... crud ...>", true, true, 500],
[Argument: (ssssbbusbbi) "libdatetime.so",    "0x8e8881c", "indicator-datetime", " 1:16:10 AM", true, true, 0, "", false, false, 550],
[Argument: (ssssbbusbbi) "libsession.so",     "0x8e6045c", "indicator-session-devices", "", false, false, 1, "<... crud ...>", true, true, 600]}]

注意:终止数字 600、550、500、450、300、250、200 从右到左相互对应,与 aps 及其指示图标相匹配。

相关内容