Edit mate-panel layout with command line

Hello everyone. Long time no post. Wishing everyone well. Thanks for clicking this.

So I'm making some scripts to automate my post-install process and I'd like to include some commands to alter the panel in the way I would like, that way I dont need to use the GUI for this.

What I usually do is move the 'window list' from the bottom panel to the top one, justified to the left. I delete the 'classic menu' and place the 'advanced-mate-menu' in it's place at the far left. I also usually increase the size of the top panel, change it's color to black, and set transparency to like 50% or whatever I like. I delete the bottom panel along with what's left there (workspace switcher and the desktop view button)

So far I've been looking this up and only learned how to do one simple thing which is increasing the size of the bottom panel with gsettings command like this:
gsettings set org.mate.panel.toplevel:/org/mate/panel/toplevels/bottom/ size 32

How do I accomplish everything I want above in one command, or something I can include in a post install script? I think it's sort of a Redmond theme, but with the panel on the top. Not sure though.

Thanks in advance for your help.

I will do such customization on Ubuntu MATE 20.04 LTS in four steps:

  1. Save current Dconf settings for MATE Panel to text file by

    dconf dump /org/mate/panel/ > ~/dconf-panel-old
    
  2. Do configuration customizations as usual by mouse and keyboard (without script).

  3. Save updated Dconf settings to text file by

    dconf dump /org/mate/panel/ > ~/dconf-panel-new
    
  4. Load updated settings by

    dconf load /org/mate/panel/ < ~/dconf-panel-new
    

Then you can change MATE Panel configuration programmatically as follows:

dconf load /org/mate/panel/ << EOF
# below are the contents of file ~/dconf-panel-new
[general]
object-id-list=['firefox', 'notification-area', 'indicatorappletcomplete', 'show-desktop', 'workspace-switcher', 'trashapplet', 'object-0']
toplevel-id-list=['top']

[objects/firefox]
launcher-location='/usr/share/applications/firefox.desktop'
locked=false
menu-path='applications:/'
object-type='launcher'
position=262
toplevel-id='top'

[objects/indicatorappletcomplete]
applet-iid='IndicatorAppletCompleteFactory::IndicatorAppletComplete'
locked=true
object-type='applet'
panel-right-stick=true
position=0
toplevel-id='top'

[objects/notification-area]
applet-iid='NotificationAreaAppletFactory::NotificationArea'
locked=true
object-type='applet'
panel-right-stick=true
position=10
toplevel-id='top'

[objects/object-0]
applet-iid='MateMenuAppletFactory::MateMenuApplet'
object-type='applet'
panel-right-stick=false
position=0
toplevel-id='top'

[objects/show-desktop]
applet-iid='WnckletFactory::ShowDesktopApplet'
locked=false
object-type='applet'
position=206
toplevel-id='top'

[objects/trashapplet]
applet-iid='TrashAppletFactory::TrashApplet'
locked=false
object-type='applet'
panel-right-stick=false
position=238
toplevel-id='top'

[objects/workspace-switcher]
applet-iid='WnckletFactory::WorkspaceSwitcherApplet'
locked=false
object-type='applet'
panel-right-stick=false
position=70
toplevel-id='top'

[toplevels/top]
expand=true
orientation='top'
screen=0
size=32

[toplevels/top/background]
color='rgba(0,0,0,0.499992)'
type='color'
EOF

then logout and login back to get new settings applied.

Optionally you can Install Meld diff-tool by sudo apt-get update && sudo apt-get install -y meld and compare two files with settings by meld ~/dconf-panel-old ~/dconf-panel-new to identify what really changed.

If you want to conduct more experiments - backup current Dconf settings with dconf dump /org/mate/ > ~/dconf-mate-full and then reset them to defaults by dconf reset -f /org/mate/ and play with the configuration, check diffs, apply settings on current or different user profile and so on.

2 Likes

Excellent examples and explanations. Thank you so much. I added this to a post install script and added some lines to set the custom theme I wanted as well. This worked great for what I wanted.

Getting closer to having a nice set of post install scripts that I can use to set my environment the way I'd like. Hopefully soon I'll learn to smash it all together into one script, but since a lot may depend on reboot or two, that may take a while to figure out.

1 Like

oh sonova... I just set up FOUR machines over the past month that I could really have used this for, but I didn't see it til now. :frowning:

Thanks, this will be a huge help going forward.