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.

I would know how to remove or hide in Ubuntu 12.04 the Chat Status section (available, away, busy, invisible and offline) from Messaging Menu as I am not using any instant messenger. I do not want to remove the entire menu, just that section.

Thank you very much and best regards!!

Chat status section screenshot

share|improve this question
add comment

3 Answers

FOR 12.04

If you're using 13.10 or newer see here..


Its possible...

pic

As you can see the status section has been removed leaving just the Broadcast and Mail sections

To put a positive spin - open-source means you have direct access to the actual source-code. You can interrogate and change the code ... as long as you give back the code changes to others!

So here goes - the following demonstrates the code changes that are required to the package indicator-messages

prerequisites

Lets get source packages from the repository:

sudo apt-get build-dep indicator-messages
apt-get source indicator-messages

This will create a folder - name will change depending upon the package version of indicator-messages. For 12.04 this folder is indicator-messages-0.6.0

code changes

Two modules in the folder indicator-messages-0.6.0 will need changing.

cd indicator-messages-0.6.0/src

status-items.c

Using your favourite editor add the line return NULL; at or around line 80 in the function "status_items_build" shown:

pic2

messages-service.c

At or around line 893 in the function "resort_menu" comment out the code shown with /* and */

pic3

lets compile

To compile this, move up to the parent folder

cd ..

Compile, make and install:

./configure
make
sudo make install

Logout and login.

to undo

To undo your changes:

cd indicator-messages-0.6.0
sudo make uninstall
sudo apt-get --reinstall install indicator-messages
share|improve this answer
2  
+1 Fantastic answer. The 'undo' bit is much appreciated too. –  Tom Brossman Apr 15 '13 at 23:37
add comment

For 13.10 and 14.04

If you're using for 12.04 see here.


Almost same steps in How to remove (or hide) Chat Status Icons from Messaging Menu

  • Install build prerequisites

    sudo apt-get build-dep indicator-messages
    
  • Download source archive

    apt-get source indicator-messages
    
  • Modify src/im-desktop-menu.c, add /* and */ to comment non needed menu as it is shown here:

    /*
    static GMenu *
    create_status_section (void)
    {
      return NULL;
      GMenu *menu;
      GMenuItem *item;
    ...
        g_object_unref (item);
        return menu;
    }
    */
    
    /*
      {
        GMenu *status_section;
    
        status_section = create_status_section();
        im_menu_append_section (IM_MENU (menu), G_MENU_MODEL (status_section));
    
        g_object_unref (status_section);
      }
    */
    

    To remove Clear menu item too:

    /*
      {
        GMenu *clear_section;
    
        clear_section = g_menu_new ();
        g_menu_append (clear_section, _("Clear"), "indicator.remove-all");
        im_menu_append_section (IM_MENU (menu), G_MENU_MODEL (clear_section));
    
        g_object_unref (clear_section);
      }
    */
    
  • Compile

    ./autogen.sh
    ./configure
    make
    
  • Install

    sudo make install
    

    Or like me I just replace it, without un-installing original (I use 64bit):

    Backup original

    sudo mv /usr/lib/x86_64-linux-gnu/indicator-messages/indicator-messages-service /usr/lib/x86_64-linux-gnu/indicator-messages/indicator-messages-service_orig
    

    Copy the new compiled version

    sudo cp ./src/indicator-messages-service /usr/lib/x86_64-linux-gnu/indicator-messages/indicator-messages-service_mod
    

    Create a link to the new compiled version

    sudo ln -s /usr/lib/x86_64-linux-gnu/indicator-messages/indicator-messages-service_mod /usr/lib/x86_64-linux-gnu/indicator-messages/indicator-messages-service
    
share|improve this answer
2  
./autogen.sh should work without sudo. It didn't work for you? weird! or you may called apt-get source indicator-messages with sudo? –  Sneetsher Feb 16 at 0:29
1  
Ok, so it works with the package-installation method, going to try your replace-only solution just to see. Your bounty is up in 19 hours (please comment if I haven't given in like 24-48h) :) –  MrVaykadji Feb 16 at 0:50
1  
I just tried it. It works fine (commenting out *clear_section) and installing the modified package with cp also works. I have a question though : i didn't follow your example and I directly copied indicator-messages-service in /urs/lib/.../indicator-messages-service, without using the ln -s. Why did you wanted me to create a symbolic link exactly ? For the updates ? –  MrVaykadji Feb 16 at 1:02
1  
Yep, updates, I want keep my modification tracked and away from default installation. As you can hold(pin) that package. –  Sneetsher Feb 16 at 1:07
1  
@brunces, Happy to hear that :) well, consider vote up instead. See askubuntu.com/help/why-vote –  Sneetsher Feb 18 at 14:06
show 7 more comments

You can remove the indicator-messages package from software center for completely remove it or see this link to configure it for your needs .

share|improve this answer
    
Thanks, I've already read this article before but I have not found what I wanted. I mean if there is any way to remove or hide the IM status icons but still use Messaging Menu for other applications like thunderbird or polly. –  user44849 Sep 7 '12 at 8:46
    
You can completely remove it and use application specific system tray icon instead. –  Saeed Zarinfam Sep 7 '12 at 8:49
    
Is that possible? A specific system tray icon to manage Thunderbird, Polly, Skype, and U1 at the same time? –  user44849 Sep 7 '12 at 8:53
    
I do not know about all your favorite program but for example i use pidgin as my messenger and i active it's system tray icon in it's setting and do not have any problem. –  Saeed Zarinfam Sep 7 '12 at 8:55
1  
Your welcome, see this link, it might help you: omgubuntu.co.uk/2010/12/… –  Saeed Zarinfam Sep 7 '12 at 9:23
show 2 more comments

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.