From 53b9f8742bad2b6d04163682fb4667516440df28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ball=C3=B3=20Gy=C3=B6rgy?= Date: Sat, 4 Apr 2026 13:07:04 +0200 Subject: [PATCH] Fix for Epiphany>=43 Recent versions of Epiphany changed the prefix from `org.gnome.Epiphany.WebApp-` to `org.gnome.Epiphany.WebApp_`, and moved the desktop file under `~/.local/share/xdg-desktop-portal/applications/`. Copying the icon is not necessary. See: https://gitlab.gnome.org/GNOME/epiphany/-/commit/878e2be89508deea76f81454ffc8706ee90b7c06 Closes: https://github.com/linuxmint/webapp-manager/issues/326 Closes: https://github.com/linuxmint/webapp-manager/issues/389 --- usr/lib/webapp-manager/common.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/usr/lib/webapp-manager/common.py b/usr/lib/webapp-manager/common.py index 58a6b80..3d8d0b1 100644 --- a/usr/lib/webapp-manager/common.py +++ b/usr/lib/webapp-manager/common.py @@ -59,6 +59,7 @@ def wrapper(*args): WATERFOX_FLATPAK_PROFILES_DIR = os.path.expanduser("~/.var/app/net.waterfox.waterfox/data") FLOORP_FLATPAK_PROFILES_DIR = os.path.expanduser("~/.var/app/one.ablaze.floorp/data") EPIPHANY_PROFILES_DIR = os.path.join(ICE_DIR, "epiphany") +EPIPHANY_DESKTOP_DIR = os.path.expanduser("~/.local/share/xdg-desktop-portal/applications/") FALKON_PROFILES_DIR = os.path.join(ICE_DIR, "falkon") ZEN_FLATPAK_PROFILES_DIR = os.path.expanduser("~/.var/app/app.zen_browser.zen/data/ice/zen/") ICONS_DIR = os.path.join(ICE_DIR, "icons") @@ -157,7 +158,7 @@ def __init__(self, path, codename): class WebAppManager: def __init__(self): - for directory in [ICE_DIR, APPS_DIR, PROFILES_DIR, FIREFOX_PROFILES_DIR, FIREFOX_FLATPAK_PROFILES_DIR, ICONS_DIR, EPIPHANY_PROFILES_DIR, FALKON_PROFILES_DIR]: + for directory in [ICE_DIR, APPS_DIR, PROFILES_DIR, FIREFOX_PROFILES_DIR, FIREFOX_FLATPAK_PROFILES_DIR, ICONS_DIR, EPIPHANY_PROFILES_DIR, EPIPHANY_DESKTOP_DIR, FALKON_PROFILES_DIR]: if not os.path.exists(directory): os.makedirs(directory) @@ -252,10 +253,13 @@ def delete_webbapp(self, webapp): # first remove symlinks then others if os.path.exists(webapp.path): os.remove(webapp.path) - epiphany_orig_prof_dir=os.path.join(os.path.expanduser("~/.local/share"), "org.gnome.Epiphany.WebApp-" + webapp.codename) + epiphany_orig_prof_dir=os.path.join(os.path.expanduser("~/.local/share"), "org.gnome.Epiphany.WebApp_" + webapp.codename) if os.path.exists(epiphany_orig_prof_dir): os.remove(epiphany_orig_prof_dir) - shutil.rmtree(os.path.join(EPIPHANY_PROFILES_DIR, "org.gnome.Epiphany.WebApp-%s" % webapp.codename), ignore_errors=True) + shutil.rmtree(os.path.join(EPIPHANY_PROFILES_DIR, "org.gnome.Epiphany.WebApp_%s" % webapp.codename), ignore_errors=True) + epiphany_desktop_path = os.path.join(EPIPHANY_DESKTOP_DIR, "org.gnome.Epiphany.WebApp_%s.desktop" % webapp.codename) + if os.path.exists(epiphany_desktop_path): + os.remove(epiphany_desktop_path) falkon_orig_prof_dir = os.path.join(os.path.expanduser("~/.config/falkon/profiles"), webapp.codename) if os.path.exists(falkon_orig_prof_dir): os.remove(falkon_orig_prof_dir) @@ -297,14 +301,11 @@ def create_webapp(self, name, desc, url, icon, category, browser, custom_paramet if browser.browser_type == BROWSER_TYPE_EPIPHANY: # Move the desktop file and create a symlink - epiphany_profile_path = os.path.join(EPIPHANY_PROFILES_DIR, "org.gnome.Epiphany.WebApp-" + codename) - new_path = os.path.join(epiphany_profile_path, "org.gnome.Epiphany.WebApp-%s.desktop" % codename) + epiphany_profile_path = os.path.join(EPIPHANY_PROFILES_DIR, "org.gnome.Epiphany.WebApp_" + codename) + new_path = os.path.join(EPIPHANY_DESKTOP_DIR, "org.gnome.Epiphany.WebApp_%s.desktop" % codename) os.makedirs(epiphany_profile_path) os.replace(path, new_path) os.symlink(new_path, path) - # copy the icon to profile directory - new_icon=os.path.join(epiphany_profile_path, "app-icon.png") - shutil.copy(icon, new_icon) # required for app mode. create an empty file .app app_mode_file=os.path.join(epiphany_profile_path, ".app") with open(app_mode_file, 'w') as fp: @@ -385,10 +386,10 @@ def get_exec_string(self, browser, codename, custom_parameters, icon, isolate_pr os.path.join(firefox_profile_path, "chrome", "userChrome.css")) elif browser.browser_type == BROWSER_TYPE_EPIPHANY: # Epiphany based - epiphany_profile_path = os.path.join(EPIPHANY_PROFILES_DIR, "org.gnome.Epiphany.WebApp-" + codename) + epiphany_profile_path = os.path.join(EPIPHANY_PROFILES_DIR, "org.gnome.Epiphany.WebApp_" + codename) # Create symlink of profile dir at ~/.local/share epiphany_orig_prof_dir = os.path.join(os.path.expanduser("~/.local/share"), - "org.gnome.Epiphany.WebApp-" + codename) + "org.gnome.Epiphany.WebApp_" + codename) os.symlink(epiphany_profile_path, epiphany_orig_prof_dir) exec_string = browser.exec_path exec_string += " --application-mode "