mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-08 09:44:15 +02:00
[fix][web] not informing StartupWMClass on generated desktop entries
This commit is contained in:
@@ -13,7 +13,7 @@ class WebApplication(SoftwarePackage):
|
||||
def __init__(self, id: str = None, url: str = None, name: str = None, description: str = None, icon_url: str = None,
|
||||
installation_dir: str = None, desktop_entry: str = None, installed: bool = False, version: str = None,
|
||||
categories: List[str] = None, custom_icon: str = None, preset_options: List[str] = None, save_icon: bool = True,
|
||||
options_set: List[str] = None):
|
||||
options_set: List[str] = None, package_name: str = None):
|
||||
super(WebApplication, self).__init__(id=id if id else url, name=name, description=description,
|
||||
icon_url=icon_url, installed=installed, version=version,
|
||||
categories=categories)
|
||||
@@ -24,6 +24,7 @@ class WebApplication(SoftwarePackage):
|
||||
self.preset_options = preset_options
|
||||
self.save_icon = save_icon # if the icon_url should be used instead of the one retrieved by nativefier
|
||||
self.options_set = options_set
|
||||
self.package_name = package_name
|
||||
|
||||
def set_version(self, version: str):
|
||||
self.version = str(version) if version else None
|
||||
@@ -38,7 +39,7 @@ class WebApplication(SoftwarePackage):
|
||||
@staticmethod
|
||||
def _get_cached_attrs() -> tuple:
|
||||
return 'id', 'name', 'version', 'url', 'description', 'icon_url', 'installation_dir', \
|
||||
'desktop_entry', 'categories', 'custom_icon', 'options_set', 'save_icon'
|
||||
'desktop_entry', 'categories', 'custom_icon', 'options_set', 'save_icon', 'package_name'
|
||||
|
||||
def can_be_downgraded(self):
|
||||
return False
|
||||
@@ -123,13 +124,17 @@ class WebApplication(SoftwarePackage):
|
||||
self.icon_url = custom_icon
|
||||
|
||||
def get_config_dir(self) -> str:
|
||||
if self.installation_dir:
|
||||
config_path = '{}/.config'.format(Path.home())
|
||||
if self.package_name:
|
||||
config_dir = '{}/.config/{}'.format(str(Path.home()), self.package_name)
|
||||
|
||||
if os.path.exists(config_path):
|
||||
config_dirs = glob.glob('{}/{}-nativefier-*'.format(config_path, self.installation_dir.split('/')[-1]))
|
||||
|
||||
if config_dirs:
|
||||
return config_dirs[0]
|
||||
if os.path.exists(config_dir):
|
||||
return config_dir
|
||||
else:
|
||||
if self.installation_dir:
|
||||
config_path = '{}/.config'.format(str(Path.home()))
|
||||
|
||||
if os.path.exists(config_path):
|
||||
config_dirs = glob.glob('{}/{}-nativefier-*'.format(config_path, self.installation_dir.split('/')[-1]))
|
||||
|
||||
if config_dirs:
|
||||
return config_dirs[0]
|
||||
|
||||
Reference in New Issue
Block a user