Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to know How can I remove all the applets from a given panel in MATE (in my case the bottom panel) from the command-line.

The panel should be left in a clean state, meaning no applets just the panel. Pretty much the opposite of what I did here. I believe the answer I got here should have some clues of what to do, but then again I'm not good at scripting.

How would I go about doing it?.

share|improve this question
LOL, another 500? Joking. I will update a script here. Happy Holiday. – John Siu Dec 26 '12 at 2:46
Hell yeah, serves for motivation I suppose :P, Thanks. Happy Holidays. – Uri Herrera Dec 26 '12 at 2:48
LOL, done!!!!!! – John Siu Dec 26 '12 at 2:59
Thanks. I'll probably need more help with MATE though. – Uri Herrera Dec 26 '12 at 3:15
I will always try :) I have multiple accounts using mate as default WM now, lol – John Siu Dec 26 '12 at 3:16
up vote 2 down vote accepted

It is actually the same script. But WITHOUT the panel deletion part. I also change *DEL_PANEL* to *TARGET_PANEL* to avoid confusion.

TARGET_PANEL is the panel name of panel to be altered.



    echo 'DEBUG: Panel Path' ${PANEL_PATH}
    echo 'DEBUG: Panel to be altered' ${TARGET_PANEL}

# -- Identify applet to be deleted

cd ${PANEL_PATH}/applets
DEL_APPLET=`grep -r ${TARGET_PANEL} *|cut -d\/ -f1`

    echo 'DEBUG: DEL_APPLET' ; for i in ${DEL_APPLET} ; do echo -e "DEBUG: \t${i}" ; done

# -- Get old applet id list

APPLET_ID_LIST_OLD=`mateconftool-2 -g /apps/panel/general/applet_id_list | cut -d\[ -f2 | cut -d\] -f1 | sed 's/,/ /g'`

    echo 'DEBUG: Old applet_id_list' ${APPLET_ID_LIST_OLD}

# -- Generate new applet id list

for i in ${APPLET_ID_LIST_OLD}
    if [[ "$DEL_APPLET" != *"${i}"* ]]
        echo -e "DEBUG: \tKeep ${i}"
        echo -e "DEBUG: \tDel  ${i}"
        # -- Delete applet folder
        rm -rf ${PANEL_PATH}/applets/${i}
APPLET_ID_LIST_NEW="[`echo ${APPLET_ID_LIST_NEW} | sed 's/ /,/g'`]"

# -- Apply new applet id list
mateconftool-2 -s /apps/panel/general/applet_id_list -t list --list-type=string "${APPLET_ID_LIST_NEW}"

    echo 'DEBUG: New applet_id_list' `mateconftool-2 -g /apps/panel/general/applet_id_list`

# -- Identify object to be deleted

cd ${PANEL_PATH}/objects
DEL_OBJECT=`grep -r ${TARGET_PANEL} *|cut -d\/ -f1`

    echo 'DEBUG: DEL_OBJECT' ; for i in ${DEL_OBJECT} ; do echo -e "DEBUG: \t${i}" ; done

# -- Get old object id list

OBJECT_ID_LIST_OLD=`mateconftool-2 -g /apps/panel/general/object_id_list | cut -d\[ -f2 | cut -d\] -f1 | sed 's/,/ /g'`

    echo 'DEBUG: Old object_id_list' ${OBJECT_ID_LIST_OLD}

# -- Generate new object id list

for i in ${OBJECT_ID_LIST_OLD}
    if [[ "$DEL_OBJECT" != *"${i}"* ]]
        echo -e "DEBUG:\tKeep ${i}"
        echo -e "DEBUG:\tDel  ${i}"
        # -- Delete object folder
        rm -rf ${PANEL_PATH}/objects/${i}
OBJECT_ID_LIST_NEW="[`echo ${OBJECT_ID_LIST_NEW} | sed 's/ /,/g'`]"

# -- Apply new object id list
mateconftool-2 -s /apps/panel/general/object_id_list -t list --list-type=string "${OBJECT_ID_LIST_NEW}"

    echo 'DEBUG: New applet_id_list' `mateconftool-2 -g /apps/panel/general/object_id_list`
share|improve this answer

Your Answer


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.