✨ feat(ui): display active window title in menu bar and set default app name to Finder

This commit is contained in:
sankalp committed 2025-08-13 00:40:13 +05:45
1 parent 88ce59eec7
commit 35c4f9c7ff
5 files changed
+77 -7

No files matched your search

+12 -3
View File
@@ -53,7 +53,7 @@ class AppName:
def format_app_name(self, title, wmclass, update=False):
# Handle case when both title and wmclass are empty (no active window)
if not title and not wmclass:
name = "Hyprland"
name = "Finder"
else:
name = wmclass
if name == "":
@@ -78,7 +78,16 @@ app_name_resolver = AppName()
def format_window(title, wmclass):
if not title and not wmclass:
# Handle the case when HyprlandActiveWindow passes "unknown" instead of empty strings
if (not title or title == "unknown") and (not wmclass or wmclass == "unknown"):
return "Finder"
# Clean up "unknown" values
if title == "unknown":
title = ""
if wmclass == "unknown":
wmclass = ""
name = app_name_resolver.format_app_name(title, wmclass, True)
return name
return name