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

panic: runtime error: index out of range [0] with length 0 #3

Open
tzimail opened this issue Sep 9, 2022 · 7 comments
Open

panic: runtime error: index out of range [0] with length 0 #3

tzimail opened this issue Sep 9, 2022 · 7 comments

Comments

@tzimail
Copy link

tzimail commented Sep 9, 2022

Hey there,

Just installed this on my arch linux system via the following package:

https://aur.archlinux.org/packages/keylight-control

When I try to run 'keylight-control' from the terminal, I get the following error:

panic: runtime error: index out of range [0] with length 0

goroutine 37 [running]:
main.main.func2()
        github.com/mschneider82/keylight-control/main.go:78 +0xca8
created by main.main
        github.com/mschneider82/keylight-control/main.go:63 +0x310

Any insight into what might be going on?

@mschneider82
Copy link
Owner

mschneider82 commented Sep 9, 2022

i think it didnt found any lights, thats why it panicd, i added a skip for this kind of failure, but i think you may not find any lights. Is keylight-systray working for you too?

Maybe should first setup your keylights in the same network (maybe with the mobile phone app first..)

You can compile and try the new version

@mschneider82
Copy link
Owner

do you have libnss-mdns installed?

@tzimail
Copy link
Author

tzimail commented Sep 9, 2022

i think it didnt found any lights, thats why it panicd, i added a skip for this kind of failure, but i think you may not find any lights. Is keylight-systray working for you too?

Maybe should first setup your keylights in the same network (maybe with the mobile phone app first..)

You can compile and try the new version

Hey thanks for the quick reply.

When I start keylight-systray, it shows my keylight listed, and its the correct one that is setup in the mobile app.

But when I try "power toggle all" nothing happens, and when I click on "settings" it crashes.

As mentioned I have had it setup through the mobile app, and its on the same network as my pc.

do you have libnss-mdns installed?

libnss-mdns is not available for arch, but I did install nss-mdns as noted on the readme

@mschneider82
Copy link
Owner

Does it work with the new version?

@tzimail
Copy link
Author

tzimail commented Sep 9, 2022

We've made some progress. I have a window open up now, but it doesn't show anything. It is the same window that opens up when I hit "settings" in keylight-systray.

After I close the window I get the following message in the console:

Xlib:  extension "NV-GLX" missing on display ":0".

But I'm not sure whether that's relevant or not.

@mschneider82
Copy link
Owner

i still think it doesnt detect the lights
try to follow this: (nsswitch shuold be correct)

#1 (comment)

in the mobile app the lights work?

@tzimail
Copy link
Author

tzimail commented Sep 11, 2022

Hey there, just wanted to follow up on this.

I have been tinkering in my free time with setting up mDns. In the end I believe it was a mis-configured nssswitch.conf file. I tinkered with it and it is now working.

For others that may stumble across this post here is what my full nsswitch.conf file looks like:

# Name Ser0vice Switch configuration file.
# See nsswitch.conf(5) for details.

passwd: files systemd mymachines
group: files [SUCCESS=merge] systemd mymachines
shadow: files systemd
gshadow: files systemd

publickey: files

hosts: mymachines mdns4_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns files mdns4 myhostname files
networks: files

protocols: files
services: files
ethers: files
rpc: files

netgroup: files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants