Closed ihsanauliaa closed 2 years ago
Add result = result.replace('DBusMenuFile' + PATHSEPERATOR, '')
to the format_path
function. Restart plasma-hud
. Does it work?
https://github.com/Zren/plasma-hud/blob/master/usr/lib/plasma-hud/plasma-hud#L99
It does work! Thank you! But I realized that I need to replace "DBusMenuFile" with "File", "DBusMenuEdit" with "Edit" etc, rather than to hide them. I made a quick and dirty fix for this problem.
def format_path(path):
#logging.debug('Path:%s', path)
result = path.replace(PATHSEPERATOR, '', 1)
result = result.replace('Root' + PATHSEPERATOR, '')
result = result.replace('Label Empty' + PATHSEPERATOR, '')
result = result.replace('_', '')
result = result.replace('DBusMenuFile', 'File')
result = result.replace('DBusMenuEdit', 'Edit')
result = result.replace('DBusMenuView', 'View')
result = result.replace('DBusMenuNavigate', 'Navigate')
result = result.replace('DBusMenuCode', 'Code')
result = result.replace('DBusMenuRefactor', 'Refactor')
result = result.replace('DBusMenuRun', 'Run')
result = result.replace('DBusMenuTools', 'Tools')
result = result.replace('DBusMenuVCS', 'VCS')
result = result.replace('DBusMenuWindow', 'Window')
result = result.replace('DBusMenuHelp', 'Help')
# return result.replace(PATHARROW, u'\u0020\u0020\u00BB\u0020\u0020')
return result
I don't really know how to fix it elegantly. It will be greatly appreciated if you find another way to fix this problem properly.
How did you even export the menu to the OS? Is there a specific package I need to install?
I am sorry but what do you mean by "export the menu to the OS"?
Can you still reproduce the bug? If you removed/comment out the .replace()
calls you added in format_path()
then restart plasma-hud
, does it still show DBusMenuFile
which you trigger plasma-hud
?
How did you install GoLand? I downloaded a GoLand-2020.2.3.tar.gz
and ran sh ./bin/goland.sh
.
What I meant by export the menu is that as you can see in the screenshot, GoLand displays the menu in the application's window. Where as Konsole has the app menu button in the titlebar. When testing, the GoLand menu was not "exported" to the DBus, so the Operating System could not display the menu in the titlebar.
I can't reproduce the bug at the moment because of a bug/regression in all Jetbrain's IDE that resulted in the global menu not working so that plasma-hud can't also be activated
All Jetbrain's IDE(s) from version 2020.2.1 upwards have this regression IIRC so unfortunately until they resolve this problem, we really can't test a fix
Ah that makes sense. Ping me when the bug is fixed upstream so I can test my regex code.
Will do!
The Jetbrains IDEs show the global menu for me today (well, Webstorm at least!), so I'm assuming the upstream bug is fixed. Can I help test anything?
About exporting the menu to the OS, on Arch these packages may be required:
libdbusmenu-gtk3
libdbusmenu-glib
appmenu-gtk-module
Try applying this patch: https://github.com/Zren/plasma-hud/commit/981b1fde410d0ee8a47478633d0958b8d6f9562f
Looks like it solves it!
Hello,
I just recently started using plasma-hud when I realized that when using any JetBrains' IDE, plasma-hud shows "DBusMenuFile" for each menu entry like in the picture below:
Is there a way to hide those "DBusMenuFile" text? I think it happens because JetBrains' IDE are based on Java so that it doesn't really play nicely with dbusmenu etc.
Thanks in advance.