Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is it possible to change the order of icons shown in the indicator applet? With Tomboy indicator, Weather indicator, Clipboard-manager indicator, Ubuntu One and Dropbox indicators and a Battery Status indicator in addition to the classic Messages indicator and Sound Menu indicator my Indicator Applet becomes a little bit messed up, sorting the icons would help a lot...

share|improve this question
    
Not an answer, but under kde (kubuntu), I can place or remove just about anything on the desktop and panel, indicators included. –  Joe Oct 12 '12 at 8:30

3 Answers 3

The official ubuntu ones (weather, ubu-one, battery, messages, me, sound, shutdown) are hardcoded in place. Sucks. The other ones should take their order using the law of first come first serve, right-left precedence. Judging from this brainstorm/feature request, the answer is: No, you cannot manually change the order of icons via the gui. But see @Ted Gould's answer.

share|improve this answer
    
I've me-too'd that bug. Nice find. Thanks. –  Scaine Feb 14 '11 at 22:35

The system indicators are in a fixed order by design. While you might not like the order, it makes support easier by having a fixed order (we can argue about the order endlessly). The application indicators work a little bit differently, they're designed so that there is a default order but applications can adjust that for continuity. For instance, if an application had two indicators that it wanted next to each other.

Because this system leads to a possible abuse by application developers there is a set of overrides in the system. The first is at the system level so that it can be managed by packages once the distro figures out there is an abusing application it can be fixed for all users. It's located at:

   /usr/share/indicator-application/ordering-override.keyfile

You can put any status notifier ID in there and give it a new ordering index that will because the new index for that application. There is also a per-user override file that can exist in your home directory at:

  ~/.local/share/indicators/application/ordering-override.keyfile

Hopefully that will give you some help in adjusting your panel the way that you prefer!

share|improve this answer
    
I got the system indicators listed in the first file. But don't have a ~/.local/share/indicators directory. Help! –  charlie May 14 '13 at 18:47
    
This answer is likely outdated, I have no such file in ~/.local. The file at /usr/share does not contain entries for all the indicator applications and changing it produced no effects. It would be nice to have an answer for 14.04. –  Luís de Sousa Jul 31 at 6:11
    
It works with Ubuntu 14.04, you just have to explicitly add every indicator you are using to the file. Run this command to find out which ones you are using: dbus-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 It won't work with Dropbox though, because the status notifier ID changes based on dropbox's PID. I've added an answer below to update the ordering-override.keyfile based on Dropbox's PID. –  Senoculus Aug 5 at 3:55

Instructions to Enable sorting the Dropbox Indicator

Follow Ted Gould's instructions then if you would like to sort the Dropbox indicator, here are a few more steps:

**Note: If you edited the file in /usr/share/... then you will have to put the script in /etc/rc.local (look for **Note below)

Because Dropbox appends the PID to the indicator name, and this changes every time Dropbox starts, you need to update the ordering-override.keyfile every time dropbox starts.

To do this, you can open a text editor, copy and paste the following script, and name it something like start-dropbox.sh. Then either right click, select "properties", go to the "permissions" tab, and check the "allow executing file as program" box, or open a terminal, navigate to the folder you put the script in, and run run 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 | cut -d" " -f5) = "" ]] && 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 | cut -d" " -f5)" = "" ]; do
        sleep 1s
    done
    sleep 4s #dropbox creates several PIDs, so wait a bit before continuing
    sed -e "s/dropbox-client-.*=/dropbox-client-$(ps aux | grep dropbox | grep dist | cut -d" " -f5)=/g" -i ~/.local/share/indicators/application/ordering-override.keyfile
    restart unity-panel-service
fi

Now you can open "Startup Applications, and make a new entry, using the full path to your script as the "command" (using ~/start-dropbox.sh won't work, you have to do /home/yourname/start-dropbox.sh).

**Note: This is where you'd add the full script path to the end of /etc/rc.local

One optional step is to open the Dropbox settings and uncheck "Start dropbox on system startup". You can't just change the command for Dropbox that is already in the Startup Applications list, because Dropbox overwrites this every time it starts.

You're done!

Here's what my ~/.local/share/indicators/application/ordering-override.keyfile looks like:

[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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.