Skip to content

Commit

Permalink
0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vinifmor authored Oct 18, 2019
2 parents 6709368 + 7f27756 commit d190142
Show file tree
Hide file tree
Showing 68 changed files with 1,879 additions and 365 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ __pycache__
dist
*.egg-info
build
*.db
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,38 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [0.7.0] 2019-10-18
### Features
- AppImage support ( see below )
- **Screenshots** button and panel
- **Categories** filter

### Improvements
- Flatpak:
- History panel now shows formatted dates
- Info available for not installed applications
- Snap:
- Improved how the the application verification is done ( if a given Snap is an application )
- AUR:
- Optional dependencies are not checked by default in their installation popup.
- History panel can now me maximized, minimized and allows to copy column content.
- It is possible to use custom tray icons via the environment variables: **BAUH_TRAY_DEFAULT_ICON_PATH** and **BAUH_TRAY_UPDATES_ICON_PATH** ( displayed when there are updates )
- Minor UI improvements

### Fixes
- cache thread lock that was eventually hanging the application
- Flatpak:
- Runtimes update-checking for version 1.5.X
- Snap:
- retrieving installed applications information for Ubuntu based distros
- Application icon replaced by the type icon in the Info, History and Screenshots panels due to unexpected Qt crashes
- minor UI fixes

### AppImage support
- Search, install, uninstall, downgrade, launch and retrieve the applications history
- Supported sources: [AppImageHub](https://appimage.github.io) ( **applications with no releases published to GitHub are currently not available** )
- Adds desktop entries ( menu shortcuts ) for the installed applications ( **~/.local/share/applications **)

## [0.6.4] 2019-10-13
### Fixes
- Flatpak update-checking for version 1.5.X
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include LICENSE CHANGELOG.md README.md
include requirements.txt
recursive-include bauh/view/resources *
recursive-include bauh/gems/*/resources *
88 changes: 55 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
**bauh** ( ba-oo ) is a graphical user interface to manage your Linux applications ( packages ) ( old **fpakman** ). It currently supports Flatpak, Snap and AUR packaging types. When you launch **bauh** you will see
**bauh** ( ba-oo ) is a graphical user interface to manage your Linux applications ( packages ) ( old **fpakman** ). It currently supports Flatpak, Snap, AppImage and AUR packaging types. When you launch **bauh** you will see
a management panel where you can search, update, install, uninstall and launch applications. You can also downgrade some applications depending on the package technology.

It has a **tray mode** (see **Settings** below) that attaches the application icon to the system tray providing a quick way to launch it. Also the icon will get red when updates are available.
Expand Down Expand Up @@ -29,19 +29,21 @@ This project has an official Twitter account ( **@bauh4linux** ) so people can s
- **flatpak**: to be able to handle Flatpak applications
- **snapd**: to be able to handle Snap applications
- **pacman**: to be able to handle AUR packages
- **wget**: to be able to handle AUR packages
- **wget**: to be able to handle AppImage and AUR packages
- **sqlite3**: to be able to handle AppImage applications
- **git**: to be able to downgrade AUR packages
- **aria2**: faster AUR source files downloading ( reduces packages installation time. More information below. )
- **aria2**: faster AppImage and AUR source files downloading ( reduces packages installation time. More information below. )
- **libappindicator3**: for the **tray mode** in GTK3 desktop environments

- [**fuse**](https://github.com/libfuse/libfuse) may be required to run AppImages on your system.

### Distribution

**AUR**

As **bauh** package. There is also a staging version (**bauh-staging**) but is intended for testing and may not work properly.
As [**bauh**](https://aur.archlinux.org/packages/bauh) package. There is also a staging version ([**bauh-staging**](https://aur.archlinux.org/packages/bauh-staging)) but is intended for testing and may not work properly.

**PyPi**
[**PyPi**](https://pypi.org/project/bauh)

```pip3 install bauh ```

Expand All @@ -53,18 +55,55 @@ If you prefer a manual and isolated installation, type the following commands wi

```
python3 -m venv env ( creates a virtualenv in a folder called **env** )
env/bin/pip install . ( install the application code inside the **env** )
env/bin/bauh ( launch the application )
env/bin/pip install . ( installs the application code inside the **env** )
env/bin/bauh ( launches the application )
```

If you do not want to clone / download this repository, go to your **Home** folder and execute the commands above, but replace the second by ```env/bin/pip install bauh```.


### Autostart
In order to autostart the application, use your Desktop Environment settings to register it as a startup application / script (**bauh --tray=1**).

### Gems ( package technology support )
#### Flatpak ( flatpak gem )
- The user is able to search, install, uninstall, downgrade, launch and retrieve the applications history

#### Snap ( snap gem )
- The user is able to search, install, uninstall, refresh, launch and downgrade applications

#### AUR ( arch gem )
- It is **not enabled by default**
- The user is able to search, install, uninstall, downgrade, launch and retrieve the packages history
- It handles conflicts, and missing / optional packages installations ( including from your distro mirrors )
- If [**aria2**](https://github.com/aria2/aria2) is installed on your system and multi-threaded downloads are enabled ( see **BAUH_DOWNLOAD_MULTITHREAD** ), the source packages
will be pre-downloaded faster ( it does **NOT** modify your **pacman** settings ).
- Automatically makes simple package compilation improvements:

a) if **MAKEFLAGS** is not set in **/etc/makepkg.conf** and **~/.makepkg.conf** does not exist,
then a copy of **/etc/makepkg.conf** will be generated at **~/.makepkg.conf** defining MAKEFLAGS to work with
the number of your machine processors (**-j${nproc}**).

b) same as previous, but related to **COMPRESSXZ** definition ( if '--threads=0' is not defined )

Obs: this feature can be disabled through the environment variable **BAUH_ARCH_OPTIMIZE=0**
( For more information about these optimizations, check: https://wiki.archlinux.org/index.php/Makepkg )
- Arch package memory-indexer running every 20 minutes. This memory index is used when AUR Api cannot handle the amount of results found for a given search. It can be disabled via the environment variable **BAUH_ARCH_AUR_INDEX_UPDATER=0**.
- If some of your installed packages are not categorized, send an e-mail to **[email protected]** informing their names and categories in the following format: ```name=category1[,category2,category3,...]```

#### AppImage ( appimage gem )
- The user is able to search, install, uninstall, downgrade, launch and retrieve the applications history
- Supported sources: [AppImageHub](https://appimage.github.io) ( **applications with no releases published to GitHub are currently not available** )
- Faster downloads if **aria2c** is installed. Same behavior described in the **AUR support** section.
- Installed applications are store at **~/.local/share/bauh/appimage/installed**
- Desktop entries ( menu shortcuts ) of the installed applications are stored at **~/.local/share/applications**
- Downloaded database files are stored at **~/.local/share/bauh/appimage** as **apps.db** and **releases.db**
- Databases updater daemon running every 20 minutes. It can be disabled via the environment variable **BAUH_APPIMAGE_DB_UPDATER=0**.
- All supported application names can be found at: https://github.com/vinifmor/bauh-files/blob/master/appimage/apps.txt

Obs: There are some crashes when **AppImageLauncher** is installed. It is advisable to uninstall it and reboot the system before trying to install an AppImage application.

### Settings

### General settings
You can change some application settings via environment variables or arguments (type ```bauh --help``` to get more information).
- **BAUH_SYSTEM_NOTIFICATIONS**: enable or disable system notifications. Use **0** (disable) or **1** (enable, default).
- **BAUH_CHECK_INTERVAL**: define the updates check interval in seconds. Default: 60.
Expand All @@ -78,48 +117,31 @@ You can change some application settings via environment variables or arguments
- **BAUH_SUGGESTIONS**: If application suggestions should be displayed if no package considered an application is installed (runtimes / libraries do not count as applications). Use **0** (disable) or **1** (enable, default).
- **BAUH_MAX_DISPLAYED**: Maximum number of displayed packages in the management panel table. Default: 50.
- **BAUH_LOGS**: enable **bauh** logs (for debugging purposes). Use: **0** (disable, default) or **1** (enable)
- **BAUH_DOWNLOAD_MULTITHREAD**: enable multi-threaded download for installation files ( only possible if **aria2** is installed ). This feature reduces applications installation time ( only supported by AUR packages at the moment ). Use **0** (disable) or **1** (enabled, default).
- **BAUH_DOWNLOAD_MULTITHREAD**: enable multi-threaded download for installation files ( only possible if **aria2** is installed ). This feature reduces the application installation time. Use **0** (disable) or **1** (enabled, default).
- **BAUH_TRAY_DEFAULT_ICON_PATH**: define a custom icon for the tray mode ( absolute path)
- **BAUH_TRAY_UPDATES_ICON_PATH** define a custom updates icon for the tray mode ( absolute path)

### How to improve **bauh** performance
- Disable package types that you do not want to deal with ( via GUI )
- If you don't care about restarting the app every time a new supported packaging technology is installed, set "check-packaging-once=1" (**bauh --check-packaging-once=1**). This can reduce the application response time up in some scenarios, since it won't need to recheck if the packaging type is available for every action you request.
- If you don't mind to see the applications icons, you can set "download-icons=0" (**bauh --download-icons=0**). The application may have a slight response improvement, since it will reduce the parallelism within it.
- Let the disk cache always enabled so **bauh** does not need to dynamically retrieve some data every time you launch it.

### Flatpak support ( flatpak gem )
- The user is able to search, install, uninstall, downgrade, laucnh and retrieve the applications history

### Snap support ( snap gem )
- The user is able to search, install, uninstall, refresh, launch and downgrade applications

### AUR support ( arch gem )
- It is **not enabled by default**
- The user is able to search, install, uninstall, downgrade, launch and retrieve the packages history
- It handles conflicts, and missing / optional packages installations ( including from your distro mirrors )
- If [**aria2**](https://github.com/aria2/aria2) is installed on your system and multi-threaded downloads are enabled ( see **BAUH_DOWNLOAD_MULTITHREAD** ), the source packages
will be pre-downloaded faster ( it does **NOT** modify your **pacman** settings ).
- Automatically makes simple package compilation improvements

a) if **MAKEFLAGS** is not set in **/etc/makepkg.conf** and **~/.makepkg.conf** does not exist,
then a copy of **/etc/makepkg.conf** will be generated at **~/.makepkg.conf** defining MAKEFLAGS to work with
the number of your machine processors (**-j${nproc}**).

b) same as previous, but related to **COMPRESSXZ** definition ( if '--threads=0' is not defined )

Obs: this feature can be disabled through the environment variable **BAUH_ARCH_OPTIMIZE=0**
( For more information about these optimizations, check: https://wiki.archlinux.org/index.php/Makepkg )

### Files and Logs
- Some application settings are stored in **~/.config/bauh/config.json**
- Installation logs are saved at **/tmp/bauh/logs/install**
- Some data about your installed applications are stored in **~/.cache/bauh** to load them faster ( default behavior ).

### [bauh-files](https://github.com/vinifmor/bauh-files)
- It is a separate repository with some files downloaded by **bauh** during runtime.

### Code structure
#### Modules

**view**: code associated with the graphical interface

**gems**: code responsible to work with the different packaging technologies (every submodule deals with one or more types)
**gems**: code responsible to work with the different packaging technologies ( every submodule deals with one or more types )

**api**: code abstractions representing the main actions that a user can do with Linux packages (search, install, ...). These abstractions are implemented by the **gems**, and
the **view** code is only attached to them (it does not know how the **gems** handle these actions)
Expand Down
6 changes: 3 additions & 3 deletions aur/panel_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
Type=Application
Name=bauh
Categories=System;
Comment=Manage your Flatpak / Snap / AUR applications
Comment[pt]=Gerencie seus aplicativos Flatpak / Snap / AUR
Comment[es]=Administre sus aplicaciones Flatpak / Snap / AUR
Comment=Manage your Flatpak / Snap / AppImage / AUR applications
Comment[pt]=Gerencie seus aplicativos Flatpak / Snap / AppImage / AUR
Comment[es]=Administre sus aplicaciones Flatpak / Snap / AppImage / AUR
Exec = {path}
Icon = {lib_path}/python{version}/site-packages/bauh/view/resources/img/logo.svg
"""
Expand Down
6 changes: 3 additions & 3 deletions aur/tray_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Name[pt] = bauh ( bandeja )
Name[es] = bauh ( bandeja )
Categories = System;
Comment=Manage your Flatpak / Snap / AUR applications
Comment[pt]=Gerencie seus aplicativos Flatpak / Snap / AUR
Comment[es]=Administre sus aplicaciones Flatpak / Snap / AUR
Comment=Manage your Flatpak / Snap / AppImage / AUR applications
Comment[pt]=Gerencie seus aplicativos Flatpak / Snap / AppImage / AUR
Comment[es]=Administre sus aplicaciones Flatpak / Snap / AppImage / AUR
Exec = {path}
Icon = {lib_path}/python{version}/site-packages/bauh/view/resources/img/logo.svg
"""
Expand Down
2 changes: 1 addition & 1 deletion bauh/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.6.4'
__version__ = '0.7.0'
__app_name__ = 'bauh'

import os
Expand Down
6 changes: 4 additions & 2 deletions bauh/api/abstract/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ApplicationContext:

def __init__(self, disk_cache: bool, download_icons: bool, http_client: HttpClient, app_root_dir: str, i18n: dict,
cache_factory: MemoryCacheFactory, disk_loader_factory: DiskCacheLoaderFactory,
logger: logging.Logger, file_downloader: FileDownloader):
logger: logging.Logger, file_downloader: FileDownloader, distro: str):
"""
:param disk_cache: if package data should be cached to disk
:param download_icons: if packages icons should be downloaded
Expand All @@ -22,7 +22,8 @@ def __init__(self, disk_cache: bool, download_icons: bool, http_client: HttpClie
:param cache_factory:
:param disk_loader_factory:
:param logger: a logger instance
:param file_downloader:
:param file_downloader
:param distro
"""
self.disk_cache = disk_cache
self.download_icons = download_icons
Expand All @@ -34,6 +35,7 @@ def __init__(self, disk_cache: bool, download_icons: bool, http_client: HttpClie
self.logger = logger
self.file_downloader = file_downloader
self.arch_x86_64 = sys.maxsize > 2**32
self.distro = distro

def is_system_x86_64(self):
return self.arch_x86_64
36 changes: 26 additions & 10 deletions bauh/api/abstract/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,29 @@ def cache_to_disk(self, pkg: SoftwarePackage, icon_bytes: bytes, only_icon: bool
:return:
"""
if self.context.disk_cache and pkg.supports_disk_cache():
self.serialize_to_disk(pkg, icon_bytes, only_icon)

if not only_icon:
Path(pkg.get_disk_cache_path()).mkdir(parents=True, exist_ok=True)
data = pkg.get_data_to_cache()
def serialize_to_disk(self, pkg: SoftwarePackage, icon_bytes: bytes, only_icon: bool):
"""
Sames as above, but does not check if disk cache is enabled or supported by the package instance
:param pkg:
:param icon_bytes:
:param only_icon:
:return:
"""
if not only_icon:
Path(pkg.get_disk_cache_path()).mkdir(parents=True, exist_ok=True)
data = pkg.get_data_to_cache()

if data:
with open(pkg.get_disk_data_path(), 'w+') as f:
f.write(json.dumps(data))
if data:
with open(pkg.get_disk_data_path(), 'w+') as f:
f.write(json.dumps(data))

if icon_bytes:
Path(pkg.get_disk_cache_path()).mkdir(parents=True, exist_ok=True)
if icon_bytes:
Path(pkg.get_disk_cache_path()).mkdir(parents=True, exist_ok=True)

with open(pkg.get_disk_icon_path(), 'wb+') as f:
f.write(icon_bytes)
with open(pkg.get_disk_icon_path(), 'wb+') as f:
f.write(icon_bytes)

@abstractmethod
def requires_root(self, action: str, pkg: SoftwarePackage):
Expand Down Expand Up @@ -238,3 +247,10 @@ def is_default_enabled(self) -> bool:
@abstractmethod
def launch(self, pkg: SoftwarePackage):
pass

@abstractmethod
def get_screenshots(self, pkg: SoftwarePackage) -> List[str]:
"""
:return: screenshot urls for the given package
"""
pass
11 changes: 9 additions & 2 deletions bauh/api/abstract/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SoftwarePackage(ABC):

def __init__(self, id: str = None, version: str = None, name: str = None, description: str = None, latest_version: str = None,
icon_url: str = None, status: PackageStatus = PackageStatus.READY, installed: bool = False, update: bool = False,
size: int = None, categories: List[str] = None):
size: int = None, categories: List[str] = None, license: str = None):
"""
:param id:
:param version:
Expand All @@ -57,6 +57,7 @@ def __init__(self, id: str = None, version: str = None, name: str = None, descri
self.update = update
self.size = size
self.categories = categories
self.license = license

@abstractmethod
def has_history(self):
Expand Down Expand Up @@ -144,7 +145,7 @@ def fill_cached_data(self, data: dict):
pass

@abstractmethod
def can_be_run(self) -> str:
def can_be_run(self) -> bool:
"""
:return: whether the app can be run via the GUI
"""
Expand All @@ -168,6 +169,12 @@ def get_custom_supported_actions(self) -> List[PackageAction]:
"""
pass

def has_screenshots(self) -> bool:
"""
:return: if there are screenshots to be displayed
"""
return not self.installed

def __str__(self):
return '{} (id={}, name={})'.format(self.__class__.__name__, self.id, self.name)

Expand Down
Loading

0 comments on commit d190142

Please sign in to comment.