BurntSushi / wingo

A fully-featured window manager written in Go.
Do What The F*ck You Want To Public License
1k stars 90 forks source link

config.go: no readable 'mouse.wini' configuration file #9

Closed vendion closed 12 years ago

vendion commented 12 years ago

Ok so I have wingo built but after adding exec wingo to my .xinitrc file and running startx Wingo fails with the following error:

WINGO ERROR: config.go:93: Could not find a readable 'mouse.wini' configuration file.

Is there something that needs done to create the required configs? I did not run wingo --replace as I also have AwesomeWM on this machine.

BurntSushi commented 12 years ago

It seems I have updated the README too soon. There are still some corners of Wingo that need a little polishing. I didn't mean for people to start using it yet. :P

The immediate fix is to cd into the Wingo build directory, and then run wingo.

One of the next things on my list is to make reading configuration files sensible. Right now it only looks in the "config" directory of the current working directory.

I did not run wingo --replace as I also have AwesomeWM on this machine.

Hmm. I'm not sure what you mean. The "replace" option only replaces the currently running window manager. It doesn't change the default WM or anything.

vendion commented 12 years ago

LOL sorry for being a little to eager, this is just something I have been wanting to try out ever sense I saw the project.

I would think having it read out of $HOME/.config/wingo would be reasonable, then again I know how frustrating it can be to have someone that does not know the code and its working tell you want should be done.

What I meant by my comment on the "replace" option is I did not know if it modified the .xinitrc file, I have mine tuned up for a different window manager and did not want to risk messing that up.

BurntSushi commented 12 years ago

LOL sorry for being a little to eager, this is just something I have been wanting to try out ever sense I saw the project.

Haha. No worries. I'm getting really close. I completely underestimated how long it takes to polish a project of this size.

I would think having it read out of $HOME/.config/wingo would be reasonable, then again I know how frustrating it can be to have someone that does not know the code and its working tell you want should be done.

Absolutely. Here is the order of config locations I'll check when I implement it:

  1. Specified on the command line.
  2. $HOME/.config/wingo/
  3. /etc/xdg/wingo/
  4. go build path (last resort)

What I meant by my comment on the "replace" option is I did not know if it modified the .xinitrc file, I have mine tuned up for a different window manager and did not want to risk messing that up.

Nope. It won't touch any files. This is what "--replace" does:

  1. Wingo starts. Looks for another window manager that is runng.
  2. If one is found, Wingo asks that window manager to die.
  3. Wingo waits for the window manager to die. When it does, Wingo starts. After some time, if the other window manager stays alive, Wingo will die.

The very worst thing that can happen is that your X server dies.

And that's it. I think awesome is a compliant window manager, so this should just work. You ought to be able to switch back to awesome from Wingo with a similar command...

BurntSushi commented 12 years ago

Just to expand on my prior comment, here is a more precise reflection of how Wingo searches for configuration files.

First we collect all directories meeting the following criteria and in the order laid out below. Then, for each configuration file, find the first readable location using each directory in the list in order and use that file. (This implies that two different config files could be read from two different config directories.)

  1. Specified configuration directory on the command line.
  2. $XDG_CONFIG_HOME/wingo if set, otherwise $HOME/.config/wingo.
  3. Every directory in $XDG_CONFIG_DIRS concatenated with /wingo if set, otherwise /etc/xdg/wingo.
  4. Every source directory in $GOPATH concatenated with /github.com/BurntSushi/wingo/config.

If a configuration file can't be found, every directory from the aforementioned list is logged to stderr.

To my knowledge this complies with the XDG Base Directory Specification.

BurntSushi commented 12 years ago

I've also added a --write-config flag to wingo, which will copy a fresh set of config files to $XDG_CONFIG_HOME/wingo if set, otherwise $HOME/.config/wingo. Copying will fail if the directory already exists. (To prevent accidentally overwriting an existing configuration.)