Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bind file not actually loading on start #11

Open
Techjar opened this issue Sep 5, 2020 · 12 comments
Open

Bind file not actually loading on start #11

Techjar opened this issue Sep 5, 2020 · 12 comments
Assignees
Labels
bug Something isn't working

Comments

@Techjar
Copy link

Techjar commented Sep 5, 2020

Simple as that. The bind file passed via --config is not actually loading, despite the log claiming that it is. I enabled DEBUG and didn't get anything more than this:

1599301254 INFO  : config_fn = /etc/g13/default.bind
1599301254 INFO  : reading configuration from /etc/g13/default.bind
@khampf
Copy link
Owner

khampf commented Sep 5, 2020

Good find, I have only tested making changes in /etc/g13/default.bind so it has not occured to me the loading might fail

@khampf khampf self-assigned this Sep 5, 2020
@khampf khampf added the bug Something isn't working label Sep 5, 2020
@khampf khampf mentioned this issue Sep 5, 2020
@Techjar
Copy link
Author

Techjar commented Sep 5, 2020

To be clear that is the file I am passing to --config, so it just fails to load any config as far as I can tell.

@tmackay
Copy link

tmackay commented Sep 8, 2020

I haven't had any issues loading config (apart from the comment thing) using the included bindfiles examples and can't see any reference to /etc/g13/default.bind - this has to be explicitly passed, right? What are the contents of your default.bind file?

@Techjar
Copy link
Author

Techjar commented Sep 8, 2020

I tried putting only binds in it (no comments or other commands) and it still didn't work. Yes it is being passed via --config, though I'm not sure what the default is. In any case, if that's part of the issue then it's still a bug.

@khampf
Copy link
Owner

khampf commented Sep 8, 2020

This should be quite easy to test with verbose debugging turned on. I can not access my Arch Linux right. I decided to work on my thesis in FreeBSD as Arch is full of distractions... like work on g13d... which I also have looked into porting to FreeBSD but try really hard not to look at right now

@Techjar
Copy link
Author

Techjar commented Sep 8, 2020

I did turn on verbose debugging (assuming that's what --log_level DEBUG does) but did not get anything particularly useful. You can see all the relevant output in my initial comment.

@tmackay
Copy link

tmackay commented Sep 8, 2020

I'm happy to take a look, but as I said, I am unable to reproduce the issue - it's working fine for me (in PopOS, a Ubuntu derivative). I could fire up Arch in Vagrant to see if it's distro related, but this is pretty low level file reading? I don't see how.
Can you try one of the included examples in bindfiles, so I have something to go off?
I'm guessing the s.good() check is failing for some reason, what about file permissions?

@Techjar
Copy link
Author

Techjar commented Sep 8, 2020

I tried chmod 777 and it still didn't work, so it's not permissions. Did you test passing a specific file path with --config?

@tmackay
Copy link

tmackay commented Sep 8, 2020

Yes, both relative and absolute worked for me. I even created one in /etc/g13/default.bind

@Techjar
Copy link
Author

Techjar commented Sep 8, 2020

I tried starcraft2.bind and none of the keys do anything. I also tried a bind file with simply bind G1 KEY_A, same result. I removed --config and the log no longer mentions loading any config file, and of course the bindings still are not functional.

@tmackay
Copy link

tmackay commented Sep 8, 2020

There's not actually any further debug messages produced in that branch of code, maybe we could add something like:
if (s.fail()) G13_LOG(log4cpp::Priority::DEBUG << "Error: " << strerror(errno));
Though that's probably worth more than a DEBUG
#18 adds error text

@nihilman
Copy link

Hello, I don't understand how you do to pass your command. I use script to run different config like this:

#!/bin/bash
cat /etc/g13/default.bind > /run/g13d/g13-0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants