3

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?

5
  • logout and relogin
    – KK Patel
    Dec 19, 2012 at 7:17
  • That's the same as restarting the panel, doesn't work. Dec 19, 2012 at 7:24
  • Do you tried removing the panel with right click of the mouse? Dec 19, 2012 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. Dec 19, 2012 at 7:55
  • 1
    @WarriorIng64 That's correct. Dec 19, 2012 at 18:31

2 Answers 2

5
+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.
1
  • Absolutely wonderful!, I can't Thank you enough. Dec 22, 2012 at 19:26
1

Setting the dconf key org.mate.session.required-component.panel to the empty string also works. You can probably do this using a dconf command like:

dconf write /org/mate/session/required-components/panel "''"

Edit: Oh, I did not see the part one of the two. Sorry. I hope it might help other people though.

You must log in to answer this question.

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