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

Some fixes to backlight module #747

Closed
wants to merge 2 commits into from
Closed

Some fixes to backlight module #747

wants to merge 2 commits into from

Conversation

thiagokokada
Copy link

@thiagokokada thiagokokada commented May 30, 2019

This PR brings 2 fixes to backlight module:

  • It fixes the following exception when the user does not have a backlight in the system (i.e. Desktop) and tries to adjust the brightness:
2019-05-27 23:05:53,754 [CRITICAL][i3pystatus.backlight.Backlight 175] Exception while processing button callback: AttributeError("'Backlight' object has no attribute 'has_xbacklight'")
2019-05-27 23:05:53,754 [CRITICAL][i3pystatus.backlight.Backlight 176] Traceback (most recent call last):
  File "/nix/store/v0km55axl2452hnsazbc1y8k0zdmcsbv-i3pystatus-unstable-2019-02-10/lib/python3.7/site-packages/i3pystatus/core/modules.py", line 162, in __button_callback_handler
    call_callback(getattr(self, cb), *args, **kwargs)
  File "/nix/store/v0km55axl2452hnsazbc1y8k0zdmcsbv-i3pystatus-unstable-2019-02-10/lib/python3.7/site-packages/i3pystatus/core/modules.py", line 133, in call_callback
    cb(*args, **kwargs)
  File "/nix/store/v0km55axl2452hnsazbc1y8k0zdmcsbv-i3pystatus-unstable-2019-02-10/lib/python3.7/site-packages/i3pystatus/backlight.py", line 93, in darker
    if self.has_xbacklight:
AttributeError: 'Backlight' object has no attribute 'has_xbacklight'
  • It allows the user to set format_no_backlight to empty string and hide backlight module in case the system does not have a backlight (i.e.:, again, in a Desktop). If you set to an empty string nowadays it results the same output as the default one, resulting in something like Brightness: -1 output.

has_xbacklight attribute would not be set in the cases where the user
does not have a backlight (i.e. Desktop), causing an exception.
This check wouldn't allow the user to set format_no_backlight to empty
string, not allowing the user to hide this widget if there is no need
(i.e. Desktop).
@thiagokokada
Copy link
Author

Superseded by PR: #749.

@thiagokokada thiagokokada deleted the fix-has-xbacklight-exception branch June 1, 2019 19:23
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

Successfully merging this pull request may close these issues.

1 participant