6

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

0

3 Answers 3

15
+200

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
1
  • 2
    +1 Fantastic answer. The 'undo' bit is much appreciated too. Apr 15, 2013 at 23:37
4
+50

For 13.10

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)
    {
      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
    

For 14.04

If you're using for 12.04 see here.

Same steps as 13.10 with different modifications


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

    /*
    static void
    menu_append_status (GMenu       *menu,
                                const gchar *label,
                        const gchar *detailed_action,
                        const gchar *icon_name)
    {
      GMenuItem *item;
      GIcon *icon;
    ...
    
      g_object_unref (icon);
      g_object_unref (item);
    }
    
    static void
    im_desktop_menu_show_chat_section (ImDesktopMenu *menu)
    {
              GMenu *status_section;
    ...
      menu->status_section_visible = TRUE;
    
      g_object_unref (status_section);
    }
    */
    ...
    
    /*
      if (g_desktop_app_info_get_boolean (app_info, "X-MessagingMenu-UsesChatSection"))
        im_desktop_menu_show_chat_section (menu);
    */
    
13
  • 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?
    – user.dz
    Feb 16, 2014 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, 2014 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, 2014 at 1:02
  • 1
    Yep, updates, I want keep my modification tracked and away from default installation. As you can hold(pin) that package.
    – user.dz
    Feb 16, 2014 at 1:07
  • 1
    @brunces, seem there were some code changes after 14.04 beta. I've updated the answer.
    – user.dz
    Apr 19, 2014 at 15:30
0

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

7
  • 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, 2012 at 8:46
  • You can completely remove it and use application specific system tray icon instead. Sep 7, 2012 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, 2012 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. Sep 7, 2012 at 8:55
  • 1
    Your welcome, see this link, it might help you: omgubuntu.co.uk/2010/12/… Sep 7, 2012 at 9:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .