More custom panel layouts

Hello Ubuntu MATE community, i seem to have encountered some problems running MATE 1.16.1, I wanted to save some custom panel layouts i made but it seems that MATE tweak only lets you use one, i searched google on how to add more customized layouts to mate tweak but no results (only an old ubuntu forum post that no one answered) I know that some layouts are in /usr/share/mate-panel/layouts/
but renaming those custom layouts doesn’t seem to work, any ideas on how to add more?

I think that the layouts are hardcoded in mate-tweak . And mate-tweak won’t really find any other layout exept {username}-tweak and the default ones . You could do a Feature request . Untill then you could load your layout by opening dconf-editor and navigating to /org/mate/panel/general and changing the layout key to your layout . Then a simple mate-panel --replace & should to the trick to reload panel.

1 Like

Holy, then how did the devs made the Mutiny, Redmond, OpenSUSE & other panels appear there? o,o

That’s right.

The answer is in the source:

    def make_list_of_panel_layouts(self):
        # Panel layouts
        panels = Gtk.ListStore(str, str)

        # Add any saved panel layouts first.
        layouts = os.path.join('/','usr','share','mate-panel','layouts','*-tweak.layout')
        for layout in glob.glob(layouts):
            current_layout = layout.replace('.layout', '').replace('/usr/share/mate-panel/layouts/', '');
            panels.append([_('Custom: ') + current_layout, current_layout])



        if self.dock is not None:
            if self.panel_layout_exists('eleven'):
                panels.append([_("Cupertino"), "eleven"])

        if self.panel_layout_exists('fedora'):
            panels.append([_("Fedora"), "fedora"])

        if self.panel_layout_exists('default'):
            panels.append([_("GNOME2"), "default"])

        if self.panel_layout_exists('linuxmint') and self.mint_menu_available:
            panels.append([_("Linux Mint"), "linuxmint"])

        if self.panel_layout_exists('mageia') and self.mageia_cc_available:
            panels.append([_("Mageia"), "mageia"])

        if self.panel_layout_exists('mutiny') and \
           self.mate_dock_available and \
           self.topmenu_available:
            panels.append([_("Mutiny"), "mutiny"])

        if self.panel_layout_exists('netbook') and self.maximus_available:
            panels.append([_("Netbook"), "netbook"])

        if self.panel_layout_exists('opensuse') and self.gnome_menu_available:
            panels.append([_("openSUSE"), "opensuse"])

        if self.panel_layout_exists('redmond'):
            panels.append([_("Redmond"), "redmond"])

        if self.panel_layout_exists('ubuntu-mate'):
            panels.append([_("Ubuntu MATE"), "ubuntu-mate"])

        if self.panel_layout_exists('wimpy'):
            panels.append([_("Wimpy"), "wimpy"])

        self.builder.get_object("combobox_panels").set_model(panels)

What does this mean, you might ask?
Well you can save additional panel layouts in the /usr/share/mate-panel/layouts folder, the only constraint for MATE Tweak to pick them up is that their name ends with “-tweak.layout”.

:warning: The following is something I’ve only tested once, less than five minutes ago on my machine so use at your own risk xD :warning:
So say you have saved your current layout and you want to back it up for future reference, issue the commands:

sudo cp /usr/share/mate-panel/layouts/$USER-tweak.layout /usr/share/mate-panel/layouts/$USER-ANT-tweak.layout
sudo cp /usr/share/mate-panel/layouts/$USER-tweak.panel /usr/share/mate-panel/layouts/$USER-ANT-tweak.panel
sudo sed -i “s/$USER-tweak/$USER-ANT-tweak/” /usr/share/mate-panel/layouts/$USER-ANT-tweak.panel

You can use something other that “ANT” to differentiate the filename.

I am qurious about this line :smiley:

Isn’t it just simple to use os.path(’/usr/share/mate-panel/layouts/*-tweak.layout’).

Yeah I’m curious about it too.
I initially though that was so one of the directories in the path could be easily changed / swapped with a variable but the next line hardcodes the whole path so it’s weird:

current_layout = layout.replace('.layout', '').replace('/usr/share/mate-panel/layouts/', '');

that seems legit but mate-tweak does not recognize it, the option becomes unavailable or no-named xD, it is fun to experiment ton these things however.

Updated to 17.10
Now, in Mate Tweak appears only the Traditional OK and Gnome2
Where are the other ones that were there previous to the update ?

W

In fresh install there are big list of layouts (17.10).
There is also an option now to create different custom layouts.

So, why by just doing the update the list of layouts is not complete ?
How do one get the whole list ?

W

what do you see in /usr/share/mate-panel/layouts ?
here is my screenshot


if there are no such layouts - i think i can upload them for you, so you place them to that folder.

Yes do see them in /usr/share/mate-panel/layouts
But they don’t show in Mate Tweak

and largest volume is 2.1 kb

W

I think you should do bugreprt, maybe developers will fix it.
p.s. as for me - mate-tweak - the most buggy thing in UM(everithing goes bad for me when i save my custom layout and try to change layots - applets become messed up an some are missing).
But it has great possibilities, so i hope the developers will fix all problems with it.

The layouts have dependancies . If you are missing mate-netbook the netbook layout will not show and etc . That is how it’s coded.

I am having the same problem. I see the layouts in the folders but not in mate tweak, can someone help?