klayoutRC and Site/Project/User Settings & Configurations

  1. We have multiple users working on multiple projects using KLayout. What is the best practice for managing/admin of site, project and user settings? Historically, we have relied on the klayoutrc file in $HOME/.klayout directory but the BIG question is whether this is the right approach or do you recommend a better methodology.

  2. Eg. Im only giving this as a simple example, but please NOTE, we have many other common settings that need to be applied across users and projects for KLayout. Currently we copy the klayoutrc file when a new user joins a project, and inside there is the line that sets the keyboard shortcuts for users. Wouldnt it be better to apply a script, when klayout starts up, that loads the keyboard shortcuts using
    mw = RBA::MainWindow.instance() mw.set_key_bindings(mw.get_default_key_bindings())

  3. Finally, I did try to find information regarding the klayoutrc file in the documentation. Did i miss any section that you can point me to pls ?

Comments

  • Hi @fawqati,

    1. You can basically place a .klayoutrc template into the central KLayout installation. When KLayout initializes the home folder for the first time, it will copy this template into the user's space. But that happens only once. When a user makes changes, these are not reset when restarting. You can force users to use "-nc" (wrapper script, alias) which means there is no update of .klayoutrc and their changes will not be persisted. Restarting KLayout gives them the defaults.

    2. A script IMHO is an better option. You can install this script in same place than the binaries (location of binary, "macros" or "pymacros" folder) and set it to autorun. Then, this script will always be run and can perform some configuration. The advantage of this approach is that you can force-reset configuration items selectively and leave others to the user.

    You can set every configuration inside such a script, i.e. key binding

    RBA::Application.instance.set_config('key-bindings',"...")
    
    1. ".klayoutrc" is a simple key/value database and a large number of application modules use it to store specific information and many different contexts. Code is the documentation and I am not going to write everything twice. After all, it's open source. The easiest way to find what you are looking for is to take a look at ".klayoutrc". Most entries are self-explaining or can be derived by observing their values after changes. Every key value corresponds to "set_config", so you can also derive the key/value combinations for the scripted approach in 2.)

    Matthias

  • @Matthias,
    Thank you. I dont know what else to say to elucidate my gratitude.

Sign In or Register to comment.