Yin-Yang icon indicating copy to clipboard operation
Yin-Yang copied to clipboard

Start Yin-Yang from menu,notify a error

Open ppaa135 opened this issue 1 year ago • 4 comments

What happened?

start Yin-Yang from menu,notify a error: Error while loading application translations! 27017D01562751654CC918609EFDD346

Version

yin-yang 3.4-1

How did you install Yin & Yang?

Git clone + running install script

What desktop environments are you seeing the problem on?

KDE

Which plugin causes the issue?

None

What software version do you use?

No response

Relevant log output

No response

ppaa135 avatar Jun 28 '24 09:06 ppaa135

Same here with debian 12 and kde plasma 5.27.

$ yin-yang -t

doesn't do anything Log when runnning

$ yin-yang
Plugin Icons has no support for your desktop environment yet!
Traceback (most recent call last):
  File "/opt/yin-yang/yin_yang/__main__.py", line 113, in <module>
    raise FileNotFoundError('Error while loading application translations!')
FileNotFoundError: Error while loading application translations!

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/opt/yin-yang/yin_yang/__main__.py", line 116, in <module>
    logger.error(str(e))
  File "/usr/lib/python3.11/logging/__init__.py", line 1518, in error
    self._log(ERROR, msg, args, **kwargs)
  File "/usr/lib/python3.11/logging/__init__.py", line 1634, in _log
    self.handle(record)
  File "/usr/lib/python3.11/logging/__init__.py", line 1644, in handle
    self.callHandlers(record)
  File "/usr/lib/python3.11/logging/__init__.py", line 1706, in callHandlers
    hdlr.handle(record)
  File "/usr/lib/python3.11/logging/__init__.py", line 978, in handle
    self.emit(record)
  File "/opt/yin-yang/yin_yang/NotificationHandler.py", line 8, in emit
    subprocess.call(['notify-send', record.levelname, str(record.msg),
  File "/usr/lib/python3.11/subprocess.py", line 389, in call
    with Popen(*popenargs, **kwargs) as p:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1024, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1901, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'notify-send'

simoncarrignon avatar Jul 13 '24 07:07 simoncarrignon

I think there is two problems: first it doesn't load the translations, which is right, but then it's the logger that fails: https://github.com/oskarsh/Yin-Yang/blob/f855d77f7a50572223459bbad67abce062c8b310/yin_yang/main.py#L110-L118 I am just skipping the line 116 as a quick fix for now!

simoncarrignon avatar Jul 13 '24 08:07 simoncarrignon

@simoncarrignon ok,I see and I fix it too with your way,thanks. And you can make yin-yang self-start when PC boot

ppaa135 avatar Jul 13 '24 09:07 ppaa135

@simoncarrignon I try to add the service for making it self -start , but it fail image

ppaa135 avatar Jul 13 '24 09:07 ppaa135

The translation error is now a warning and shouldn't bother anymore. For automation, you want to enable yin_yang.timer instead, but this should in theory already be done by the app once you set times or sunset/sunrise.

l0drex avatar May 10 '25 14:05 l0drex