Friday, May 3, 2024
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 6379  / 3 Years ago, mon, september 27, 2021, 5:19:35

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?


More From » command-line

 Answers
0

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: Keep ${i}"
TOPLEVEL_ID_LIST_NEW="${TOPLEVEL_ID_LIST_NEW} ${i}"
else
echo -e "DEBUG: Del ${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: ${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: Keep ${i}"
APPLET_ID_LIST_NEW="${APPLET_ID_LIST_NEW} ${i}"
else
echo -e "DEBUG: Del ${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: ${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: Keep ${i}"
OBJECT_ID_LIST_NEW="${OBJECT_ID_LIST_NEW} ${i}"
else
echo -e "DEBUG: Del ${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.


[#33615] Tuesday, September 28, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
zombieptu

Total Points: 490
Total Questions: 121
Total Answers: 108

Location: Nepal
Member since Mon, Jan 4, 2021
3 Years ago
zombieptu questions
Sat, Feb 18, 23, 20:00, 1 Year ago
Sun, Feb 27, 22, 02:41, 2 Years ago
Sat, Oct 30, 21, 00:00, 3 Years ago
;