sunaku / wmiirc

Ruby configuration for WMII window manager
ISC License
82 stars 26 forks source link

launch.yaml overrides script:after #33

Closed 0x64746b closed 12 years ago

0x64746b commented 12 years ago
WARN -- : value ["action 'launch_menu_rehash'"] from "/home/dtk/.wmii-hg/control/action/launch.yaml" overrides "action 'autostart_programs'\n" from "/home/dtk/.wmii-hg/config.yaml" in section "script:after"
  1. I'd like to be able to use the (no question) useful launch_menu_rehash action that is the default for script:after as well as append my own actions (preferably without cnp'ing it ;))
  2. User config settings should override defaults (usually they do?)
sunaku commented 12 years ago

That is strange. Your config seems to define a single string value for the script:after key. The YAML schema should have caught this invalid usage. Anyway, you are supposed to provide an array of strings to the script:after key; each string in that array is executed after the config is loaded.

This will address you first point. As for your second point, yes, user settings do override defaults.

0x64746b commented 12 years ago

dammit. should have posted the section from the config -.- Will check tomorrow at office.

I assume providing a valid config will override the default, but I will then be able to call launch_menu_rehash manually, since it was imported with launch.yaml?

sunaku commented 12 years ago

In this case, since script:after points to an Array, your value will "override" in the following way:

If the object being overwritten is an array, then items from the new array are appended to end of the old array.

In short, look at your config.dump file and you'll see something like this:

script:
  after:
    - action 'launch_menu_rehash' # default stuff from launch.yaml
    - action 'your stuff' # your stuff from config.yaml
0x64746b commented 12 years ago

uh, awesome. really neat. I'm really looking forward to getting my config together tomorrow ^^ Thx for your support (and your patience -.-)