mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 01:14:15 +02:00
fix: retrieving installed applications information for Ubuntu based distros
This commit is contained in:
@@ -18,6 +18,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- History panel can now me maximized, minimized and allows to copy column content.
|
||||
- Minor UI improvements
|
||||
|
||||
### Fixes
|
||||
- Snap:
|
||||
- retrieving installed applications information for Ubuntu based distros
|
||||
|
||||
### AppImage support
|
||||
- Search, install, uninstall, downgrade, launch and retrieve the applications history available in [AppImageHub](https://appimage.github.io)
|
||||
- Adds desktop entries ( menu shortcuts ) for the installed applications ( **~/.local/share/applications **)
|
||||
|
||||
@@ -9,6 +9,7 @@ from bauh.gems.snap.model import SnapApplication
|
||||
BASE_CMD = 'snap'
|
||||
RE_SNAPD_STATUS = re.compile('\s+')
|
||||
SNAPD_RUNNING_STATUS = {'listening', 'running'}
|
||||
UBUNTU_DISTRO = 'ubuntu' in run_cmd('cat /proc/version').lower()
|
||||
|
||||
|
||||
def is_installed():
|
||||
@@ -98,7 +99,12 @@ def read_installed() -> List[dict]:
|
||||
if idx > 0 and app_str:
|
||||
apps.append(app_str_to_json(app_str))
|
||||
|
||||
info_out = new_subprocess(['cat', *['/var/lib/snapd/snap/{}/current/meta/snap.yaml'.format(a['name']) for a in apps]]).stdout
|
||||
if UBUNTU_DISTRO:
|
||||
path = '/snap/{}/current/meta/snap.yaml'
|
||||
else:
|
||||
path = '/var/lib/snapd/snap/{}/current/meta/snap.yaml'
|
||||
|
||||
info_out = new_subprocess(['cat', *[path.format(a['name']) for a in apps]]).stdout
|
||||
|
||||
idx = -1
|
||||
for o in new_subprocess(['grep', '-E', '(summary|apps)', '--colour=never'], stdin=info_out).stdout:
|
||||
|
||||
Reference in New Issue
Block a user