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.

On a default installation MATE sets up two panels (top and bottom), I'd like to have the top panel removed using mateconftool-2 or another tool using the command line (Terminal).

I can't find how to do this though (from the Terminal), so I tried deleting the directory in ~/.mateconf/apps/panel/toplevels/ and restarting the panel but it does nothing and so the panel is still there.

How can I remove one of the panels not using the GUI?

share|improve this question
    
logout and relogin –  K.K Patel Dec 19 '12 at 7:17
    
That's the same as restarting the panel, doesn't work. –  Uri Herrera Dec 19 '12 at 7:24
    
Do you tried removing the panel with right click of the mouse? –  NotFromBrooklyn Dec 19 '12 at 7:53
2  
@NotFromBrooklyn He said he didn't want a GUI way of doing it. My guess is that the OP might want a command that he can put into a post-install script to automatically customize future MATE installations. –  Christopher Kyle Horton Dec 19 '12 at 7:55
1  
@WarriorIng64 That's correct. –  Uri Herrera Dec 19 '12 at 18:31

1 Answer 1

up vote 3 down vote accepted
+400

After some trail and error, countless directory, file diff-ing, and also digging a little bit into Mate-Panel source code (panel.c), confirmed following:

Step to remove panel manually

(1) All objects of target panel have to be removed

  • Delete object's folder in ~/mateconf/app/panel/objects/
  • Delete object's reference from /apps/panel/general/object_id_list in ~/mateconf/app/general/%mateconf.xml

(2) All applets of target panel have to be removed

  • Delete applet's folder in ~/mateconf/app/panel/applets/
  • Delete applet's reference from /apps/panel/general/applet_id_list in ~/mateconf/app/general/%mateconf.xml

(3) Remove Panel

  • Delete panel's folder in ~/mateconf/app/panel/toplevels/
  • Delete panel's reference from /apps/panel/general/toplevel_id_list in ~/mateconf/app/general/%mateconf.xml

Long story short, following is the result

DEL_PANEL is panel to be deleted. Currently is set to top panel.

#!/bin/bash

PANEL_PATH="${HOME}/.mateconf/apps/panel"
DEL_PANEL='top_panel_screen0'

    echo 'DEBUG: Panel Path' ${PANEL_PATH}
    echo 'DEBUG: Panel to be deleted' ${DEL_PANEL}

# -- Get old toplevel id list

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

    echo 'DEBUG: Old toplevel_id_list' ${TOPLEVEL_ID_LIST_OLD}

# -- Generate new toplevel id list

TOPLEVEL_ID_LIST_NEW=''
for i in ${TOPLEVEL_ID_LIST_OLD}
do
    if [[ "$DEL_PANEL" != *"${i}"* ]]
    then
        echo -e "DEBUG: \tKeep ${i}"
        TOPLEVEL_ID_LIST_NEW="${TOPLEVEL_ID_LIST_NEW} ${i}"
    else
        echo -e "DEBUG: \tDel  ${i}"
        # -- Delete panel folder
        rm -rf ${PANEL_PATH}/toplevels/${i}
    fi
done
TOPLEVEL_ID_LIST_NEW="[`echo ${TOPLEVEL_ID_LIST_NEW} | sed 's/ /,/g'`]"

# -- Apply new toplevel id list
mateconftool-2 -s /apps/panel/general/toplevel_id_list -t list --list-type=string "${TOPLEVEL_ID_LIST_NEW}"

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


# - APPLETS
# -- Identify applet to be deleted

cd ${PANEL_PATH}/applets
DEL_APPLET=`grep -r ${DEL_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

APPLET_ID_LIST_NEW=''
for i in ${APPLET_ID_LIST_OLD}
do
    if [[ "$DEL_APPLET" != *"${i}"* ]]
    then
        echo -e "DEBUG: \tKeep ${i}"
        APPLET_ID_LIST_NEW="${APPLET_ID_LIST_NEW} ${i}"
    else
        echo -e "DEBUG: \tDel  ${i}"
        # -- Delete applet folder
        rm -rf ${PANEL_PATH}/applets/${i}
    fi
done
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`


# - OBJECTS
# -- Identify object to be deleted

cd ${PANEL_PATH}/objects
DEL_OBJECT=`grep -r ${DEL_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

OBJECT_ID_LIST_NEW=''
for i in ${OBJECT_ID_LIST_OLD}
do
    if [[ "$DEL_OBJECT" != *"${i}"* ]]
    then
        echo -e "DEBUG:\tKeep ${i}"
        OBJECT_ID_LIST_NEW="${OBJECT_ID_LIST_NEW} ${i}"
    else
        echo -e "DEBUG:\tDel  ${i}"
        # -- Delete object folder
        rm -rf ${PANEL_PATH}/objects/${i}
    fi
done
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`

Testing Environment

  • OS: Ubuntu 12.04 LTS
  • Mate Desktop: 1.4.x, Mate Official Repo for Ubuntu from here.
share|improve this answer
    
Absolutely wonderful!, I can't Thank you enough. –  Uri Herrera Dec 22 '12 at 19:26

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.