Closed matthis-k closed 2 years ago
Well, it's not that easy. It happens to me sometimes, but I haven't yet managed to make it happen on demand. The steps you described above don't reproduce the misbehavior on my machine. Further investigation needed.
I just also tested it on my desktop machine: also duplicates.
Here the terminal output from nwg-panel-config
that might be useful to you and a screenshot afterwards:
Running on sway
28 signal received
17 signal received
Restarting panels
Dependencies check: {'light': True, 'brightnessctl': True, 'pamixer': True, 'pactl': True, 'playerctl': True, 'netifaces': True, 'btmgmt': True, 'wlr-randr': False, 'upower': True, 'swaync': True}
Running instance killed, PID 2628553
Running on sway
Output: HDMI-A-1, position: bottom, layer: bottom, width: 1920, height: 30
Output: HDMI-A-1, position: top, layer: bottom, width: 1920, height: 30
Command 'upower -i $(upower -e | grep devices/battery) | grep --color=never -E 'state|to\ full|to\ empty|percentage'' returned non-zero exit status 1.
Output: DP-1, position: top, layer: bottom, width: 1920, height: 30
28 signal received
host.init(): running dasbus.EventLoop
Exception in thread Thread-14 (init):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1009, in _bootstrap_inner
self.run()
StatusNotifierHostInterface -> watcher_available_handler
File "/usr/lib/python3.10/threading.py", line 946, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.10/site-packages/nwg_panel/modules/sni_system_tray/watcher.py", line 214, in init
session_bus.register_service(WATCHER_SERVICE_NAME)
File "/usr/lib/python3.10/site-packages/dasbus/connection.py", line 262, in register_service
raise ConnectionError("Name request has failed: {}".format(result))
ConnectionError: Name request has failed: 2
No backlight controller was found, so we could not decide an automatic target. The current command will have no effect. Please use -L to find a target and then specify it with -s.
Command 'upower -i $(upower -e | grep devices/battery) | grep --color=never -E 'state|to\ full|to\ empty|percentage'' returned non-zero exit status 1.
No backlight controller was found, so we could not decide an automatic target. The current command will have no effect. Please use -L to find a target and then specify it with -s.
Note: I just noticed I also click apply
, otherwise there is no duplication.
Edit: Never mind, it seems to be rather random, just try it a few times. It also seems to work without an edit.
As you can see here, the first time it just refreshes one of the bars, then it adds another one.
This is damned difficult to nail. I've just pressed "Save & restart" 50 times in a row, to no avail.
Maybe try using a different preset? I think the active one is preset 0 and i am starting preset 1.
I use preset-0 99% of time, and the bug shows up occasionally, say once 2 days. I think it must be located somewhere in main.py lines 290 - 299. I'll get back to the issue as soon as I finish what I'm working on now.
I've got the problem sometimes too, no matter what preset or custom config.
Maybe it helps to know, that killall nwg-panel
only works if the described behaviour isn't present. If the panel gets duplicated only killall -S SIGKILL nwg-panel
works. So maybe its something with the SIGTERM
-handlers at line 76?
Good point. I'll take a closer look at it soon. Sorry for the delay. I've been struggling with several dozen of lines of code since Thursday, and got it to work last night at 4 am. Need to test them while I still understand how the hell it works. ;)
Hopefully it should be fixed now (on the timeout
branch). I'll test till tomorrow and merge, if nothing unexpected happens.
Is'nt this bug fixed in merge f5622e1a35e63840fb1826a2ef35a8edb9dfcbc2?
That's what I meant.
Describe the bug more than one panel
To Reproduce Steps to reproduce the behavior:
nwg-panel-config
Save & restart
Expected behavior The current one gets terminated and the new one starts
Screenshots
Desktop (please complete the following information):
sway -v
: 1.7nwg-panel -v
: 0.6.1Additional context Can provide if needed