0

I am trying to read and write the panel configuration file (~/.config/lxpanel/LXDE-pi/panel ).
I was planning to use some dedicated Python library for the purpose but I cannot recognise the file format.

The file starts like:

# lxpanel <profile> config file. Manually editing is not recommended.
# Use preference dialog in lxpanel to adjust config when you can.

Global {
  edge=top
  allign=left
  margin=0
  *... more properties here ...*
  background=0
  backgroundfile=/usr/share/lxpanel/images/background.png
  iconsize=28
  monitor=0
}
Plugin {
  type=space
  Config {
    Size=4
  }
}
Plugin {
  type=menu
  Config {
  ...............

It doesn't look like any YAML, INI, JSON or XML file format I am familiar to work with with python libraries.

I know I can use a Python or bash script with some find/replace strategy but I would like to have a bit more control on the process.

Could someone please tell me the type of format of this file or give me a hint on how to handle it programmatically?

1
0

lxpanel is based off of fbpanel. There's info on the file format at his github, and the associated project page. https://github.com/aanatoly/fbpanel

I was looking for info as well, because in the README, he says "Legal values are..." then specifies "systray" as one of the options - however, it's unusable.

Didn't find out 'til later on, while perusing through lxpanel's config, that they were nearly identical, and tray works fine in both apps. Perhaps it was "systray" in a previous version.

Not sure where the parser is located, but I'm certain you can find it, either in that repo, or the one for lxpanel.

If you want to roll-your-own, he gives specifics in that README about how whitespace is stripped, and capitalization is discarded for keywords, but not their values. There were a few other things, mentioned closing brackets } had to be on a newline.

Found README location from man fbpanel
said it was located at /usr/share/doc/fbpanel/README

but that's gzipped, so you'll need to extract it:
sudo gzip -d /usr/share/doc/fbpanel/README.gz

If you don't have access to fbpanel, I would imagine that text exists on the repo or website.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.