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

Crashes when /dev/i2c-* are not accessible for the user #235

Open
steho opened this issue Jan 20, 2023 · 0 comments
Open

Crashes when /dev/i2c-* are not accessible for the user #235

steho opened this issue Jan 20, 2023 · 0 comments

Comments

@steho
Copy link

steho commented Jan 20, 2023

Describe the bug
Release v2.4 crashes when /dev/i2c-* are not accessible for the user

version
v2.4

To Reproduce
Steps to reproduce the behavior:

$ sudo modprobe i2c-dev
$ ls -l /dev/i2c-7
crw-rw---- 1 root i2c 89, 7 20. Jan 11:15 /dev/i2c-7
$ # user is not member in group i2c
$ brightness-controller 
Traceback (most recent call last):
  File "/usr/bin/brightness-controller", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.10/site-packages/brightness_controller_linux/init.py", line 903, in main
    WINDOW = MyApplication()
  File "/usr/lib/python3.10/site-packages/brightness_controller_linux/init.py", line 139, in __init__
    self.generate_dynamic_items()
  File "/usr/lib/python3.10/site-packages/brightness_controller_linux/init.py", line 267, in generate_dynamic_items
    self.generate_brightness_sources()
  File "/usr/lib/python3.10/site-packages/brightness_controller_linux/init.py", line 282, in generate_brightness_sources
    self.ui.secondary_combo.addItem(self.displayNames[i])
IndexError: list index out of range
$ sudo rmmod i2c-dev
$ brightness-controller 
No /dev/i2c devices exist.
ddcutil requires module i2c-dev.
error: Command '['ddcutil', 'detect']' returned non-zero exit status 1.
[]
False

Expected behavior
Either an error message or just grayed out option to use ddc

Screenshots
M.A.

Desktop (please complete the following information):
Manjaro Linux

Additional context
This issue seems to have been introduced with this issue and was already reported here

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

1 participant