ubuntu-mate / mate-tweak

Tweak tool for the MATE Desktop

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ability to set panel layout via command line

shuhaowu opened this issue · comments

Right now I found most of the settings in mate can be set via dconf, which is pretty convenient for provisioning a machine. On ubuntu, the one exception I found is the layout set via mate-tweak. I read the code and understand that the general idea is that it simply use dconf to restore the settings at /usr/share/mate-panel/layouts/<layout-name>.panel

Naively, i would just restore dconf with that file. However, I found that mate-tweak also does a bunch of stuff like restarting the indicators, something about the brisk menu, and reloading the panels. This makes it much more difficult to set the panel layout without having to restart the machine.

I've created a very hacky script to allow me to set the panel via command line without having to restart:

#!/usr/bin/python3

import imp
import sys

mt = imp.load_source("mate_tweak", "/usr/bin/mate-tweak")
mate_tweak = mt.MateTweak()

mate_tweak.set_string("org.mate.panel", None, "default-layout", sys.argv[1])
mate_tweak.replace_panel_layout(sys.argv[1])

This is pretty hacky for provisioning and I assume it'll break even more frequently than dconf keys changing.. My question is: is the ubuntu-mate team responsive to a patch that would allow mate-tweak --set-panel-layout <layout> to be a thing?

mate-panel already has options to change the layout.

Oops. I closed this in error. I thought this was a request against mate-panel.

Just as a note, the mate-panel approach doesn't seem to correctly set the layout. It approximately is correct but some widgets just don't show up. Not quite sure why.

But thanks for implementing this!

Just as a note, the mate-panel approach doesn't seem to correctly set the layout. It approximately is correct but some widgets just don't show up. Not quite sure why.

But thanks for implementing this!

Not only this, but it doesn't even put the panels onto the correct monitors if you're using multiple monitors.