有没有办法改变指示器小程序中显示的图标顺序?我安装了Tomboy指示器、天气指示器、剪贴板管理器指示器、Ubuntu One和Dropbox指示器,还有一个电池状态指示器,除了经典的消息指示器和声音菜单指示器。我的指示器小程序有点乱,如果能排序图标就好了...
/usr/share/indicator-application/ordering-override.keyfile
~/.local/share/indicators/application/ordering-override.keyfile
~/.local/share/indicators
目录。求助! - charlie~/.local
目录下我没有这样的文件。在/usr/share
目录下的文件并不包含所有指示器应用程序的条目,而且更改它也没有产生任何效果。希望能够得到一个适用于14.04版本的答案。 - Luís de Sousadbus-send --type=method_call --print-reply --dest=com.canonical.indicator.application /com/canonical/indicator/application/service com.canonical.indicator.application.service.GetApplications | grep "object path" | sed 's/_/-/g' | cut -d"/" -f5
然而,它无法与Dropbox一起工作,因为状态通知器ID会根据Dropbox的PID而变化。我已经在下面添加了一个答案,以根据Dropbox的PID更新ordering-override.keyfile。 - Gruzzles.local
目录下创建了文件,但是没有看到它起作用。原始的全局文件在/usr/share
目录中存在,这表明它应该可以工作。这个文件的解析是否被记录在任何地方?有没有办法调试是否出现了任何问题? - Jean Jordaan官方的Ubuntu图标(天气、ubu-one、电池、信息、我、声音、关机)是硬编码在固定位置的。很糟糕。其他图标应该按照先到先得、从左到右的优先顺序排列。根据这个头脑风暴/功能请求,答案是:不,你不能通过图形界面手动更改图标的顺序。但可以参考@Ted Gould的回答。
要更改Unity面板上应用程序指示器的位置,您必须编辑一个名为ordering-override.keyfile
的文件,该文件位于/usr/share/indicator-application
下。由于编辑此文件将更改所有用户的设置,您可以将其复制到~/.local/share/indicators/application/ordering-override.keyfile
并仅为您自己的用户进行更改:
mkdir -p ~/.local/share/indicators/application
cp /usr/share/indicator-application/ordering-override.keyfile ~/.local/share/indicators/application/
gedit ~/.local/share/indicators/application/ordering-override.keyfile
nm-applet
,其值为"1",意味着它将作为第一个应用指示器从右到左显示在面板上。transmission=6
,这将使Transmission应用指示器显示为面板上的第6个指示器(从右到左),如果其他5个指示器存在的话。ordering-override.keyfile
文件应该如下所示:[Ordering Index Overrides]
nm-applet=1
My_Weather_Indicator=2
lang_indicator=3
bluetooth_manager=4
indicator_sysmonitor=5
transmission=6
.local
中创建了文件,但没有看到它起作用。原始的全局文件在/usr/share
中存在,这表明它应该可以工作。这个文件的解析是否被记录在任何地方?如果有什么问题,有没有调试的方法? - Jean Jordaankill $(pgrep unity-panel-service)
之后,它确实起作用了 :-) 我在创建完 ordering-override.keyfile
后重新启动了系统,所以不知道为什么这个面板重启后才生效。 - Jean Jordaanroot@laptop:~# restart unity-panel-service
不再起作用了:
restart: 无法连接到 Upstart:无法连接到套接字 /com/ubuntu/upstart:拒绝连接
。 - Jean Jordaan启用排序 Dropbox 指示器的说明
按照 Ted Gould 的说明操作,然后如果您想要对 Dropbox 指示器进行排序,还需要执行以下几个步骤:
注意:如果您在 /usr/share/...
中编辑了文件,则必须将脚本放置在 /etc/rc.local
中(请参阅下面的注意)
由于 Dropbox 将 PID 附加到指示器名称中,并且每次启动 Dropbox 时都会更改,因此您需要在每次启动 Dropbox 时更新 ordering-override.keyfile
。
为此,您可以打开文本编辑器,复制并粘贴以下脚本,并将其命名为类似于 start-dropbox.sh
的名称。然后,要么右键单击,选择“属性”,转到“权限”选项卡,并选中“允许将文件作为程序执行”框,要么打开终端,导航到您放置脚本的文件夹,并运行sudo chmod 755 ./start-dropbox.sh
#!/bin/bash
#Disclaimer: This script is intended for use with Ubuntu 14.04. You alone are responsible any consequence resulting from its use.
#The purpose of this script is to start dropbox, update the keyfile, and restart the indicator panel.
#Start dropbox if not already started (for some reason pgrep didn't work)
[[ $(ps aux | grep dropbox | grep dist | awk '{print $2 }') = "" ]] && dropbox start -i
#If the override file exists
if [[ -e ~/.local/share/indicators/application/ordering-override.keyfile ]]
then
while [ "$(ps aux | grep dropbox | grep dist | awk '{print $2 }')" = "" ]; do
sleep 1s
done
sleep 5s #dropbox creates several PIDs, so wait a bit before continuing
sed -e "s/dropbox-client-.*=/dropbox-client-$(ps aux | grep dropbox | grep dist | awk '{print $2 }')=/g" -i ~/.local/share/indicators/application/ordering-override.keyfile
restart unity-panel-service
fi
[Ordering Index Overrides]
multiload=13
My-Weather-Indicator=12
redshift=11
Diodon=10
Chars=9
indicator-brightness=8
dropbox-client-24651=7
nm-applet=6
gnome-power-manager=5
ibus=4
gst-keyboard-xkb=3
gsd-keyboard-xkb=2
chrome-app-indicator-1=1