Skip to content

Commit

Permalink
0.10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
vinifmor authored May 30, 2022
2 parents d1ddacc + 952eb2f commit 30d2d58
Show file tree
Hide file tree
Showing 70 changed files with 2,017 additions and 698 deletions.
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,62 @@ 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.10.3] 2022-05-30

### Features
- General
- new parameter `--suggestions`: forces loading software suggestions after the initialization process [#260](https://github.com/vinifmor/bauh/issues/260)
- allowing custom suggestions / curated software to be mapped by Linux distributions (more on [README.md](https://github.com/vinifmor/bauh#suggestions)) [#260](https://github.com/vinifmor/bauh/issues/260)

### Improvements
- Arch
- suggestions available for repository packages (and the associated caching expiration property `suggestions_exp`. Default: 24 hours)

- General
- preventing command injection through the search mechanism [#266](https://github.com/vinifmor/bauh/issues/266)
- code refactoring

- UI
- manage window minimum width related to the table columns
- table columns width for maximized window
- settings window size rules moved to stylesheet files
- enforcing maximum width and height for the management window based on the primary screen resolution [#261](https://github.com/vinifmor/bauh/issues/261)
- some columns of the management window now have their widths limit based on a percentage of the primary screen's width:
- name limit: 15%
- description limit: 18%
- publisher limit: 12%
- version: the limit for displaying both the installed and latest versions is 22% (otherwise just the latest version will be displayed)
- auto-resizing the management panel when filters are applied

- Settings
- new property to disable SSL checking when downloading files (disabled by default)

<p align="center">
<img src="https://raw.githubusercontent.com/vinifmor/bauh-files/master/pictures/releases/0.10.3/check_ssl.png">
</p>

- the default value for `suggestions.by_type` is now `15`.

### Fixes
- Arch
- conflict resolution: removing hard dependencies that would be satisfied with the inclusion of the new package [#268](https://github.com/vinifmor/bauh/issues/268)
- e.g: `pipewire-pulse` conflicts with `pulseaudio`. `pulseaudio-alsa` (a dependency of pulseaudio) should not be removed, since `pipewire-pulse` provides `pulseaudio`
- AUR:
- build: error raised when the temporary directory does not exist (when changing the CPUs governors)
- date parsing when checking for updates
- not caching the 'LastModified' field of installed AUR dependencies (could lead to wrong display updates)

- Flatpak
- not all selected runtime partials to upgrade are actually requested to be upgraded

- Web
- not reading from the cached suggestions file after the first request
- not detecting some generated apps as installed

- UI
- double suggestions loading call when no app is returned


## [0.10.2] 2022-04-16
### Improvements
- Arch
Expand Down
44 changes: 37 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[![GitHub release](https://img.shields.io/github/release/vinifmor/bauh.svg?label=Release)](https://github.com/vinifmor/bauh/releases/) [![PyPI](https://img.shields.io/pypi/v/bauh?label=PyPI)](https://pypi.org/project/bauh) [![AUR](https://img.shields.io/aur/version/bauh?label=AUR)](https://aur.archlinux.org/packages/bauh) [![AUR-staging](https://img.shields.io/aur/version/bauh-staging?label=AUR-staging)](https://aur.archlinux.org/packages/bauh-staging) [![License](https://img.shields.io/github/license/vinifmor/bauh?label=License)](https://github.com/vinifmor/bauh/blob/master/LICENSE) [![kofi](https://img.shields.io/badge/Ko--Fi-Donate-orange?style=flat&logo=ko-fi)](https://ko-fi.com/vinifmor) [![Follow on Twitter](https://img.shields.io/twitter/follow/bauh4linux?style=social&label=Twitter)](https://twitter.com/bauh4linux)

**bauh** (ba-oo), formerly known as **fpakman**, is a graphical interface for managing your Linux software (packages/applications). It currently supports the following formats: AppImage, ArchLinux packages (including AUR), Debian packages, Flatpak, Snap and Web applications.
**bauh** (ba-oo), formerly known as **fpakman**, is a graphical interface for managing your Linux software (packages/applications). It currently supports the following formats: AppImage, Debian and Arch Linux packages (including AUR), Flatpak, Snap and Web applications.

Key features
- A management panel where you can: search, install, uninstall, upgrade, downgrade and launch you applications (and more...)
- A management panel where you can: search, install, uninstall, upgrade, downgrade and launch your applications
- Tray mode: it launches attached to the system tray and publishes notifications when there are software updates available
- System backup: it integrates with [Timeshift](https://github.com/teejee2008/timeshift) to provide a simple and safe backup process before applying changes to your system
- Custom themes: it's possible to customize the tool's style/appearance. More at [Custom themes](#custom_themes)
Expand Down Expand Up @@ -32,6 +32,7 @@ Key features
- [Native Web applications](#type_web)
7. [General settings](#settings)
- [Forbidden packaging formats](#forbidden_gems)
- [Custom suggestions / curated software](#suggestions)
8. [Directory structure, caching and logs](#dirs)
9. [Custom themes](#custom_themes)
10. [Tray icons](#tray_icons)
Expand Down Expand Up @@ -213,7 +214,6 @@ bauh is officially distributed through [PyPi](https://pypi.org/project/bauh) and
- Downloaded database files are stored at `~/.cache/bauh/appimage` (or `/var/cache/bauh/appimage` for **root**) as **apps.db** and **releases.db**
- Databases are updated during the initialization process if they are considered outdated
- The configuration file is located at `~/.config/bauh/appimage.yml` (or `/etc/bauh/appimage.yml` for **root**) and it allows the following customizations:
- Applications with ignored updates are defined at `~/.config/bauh/appimage/updates_ignored.txt` (or `/etc/bauh/appimage/updates_ignored.txt` for **root**)

```
database:
Expand All @@ -222,6 +222,9 @@ suggestions:
expiration: 24 # defines the period (in hours) in which the suggestions stored in disc will be considered up to date. Use 0 if you always want to update them. Default: 24.
```

- Applications with ignored updates are defined at `~/.config/bauh/appimage/updates_ignored.txt` (or `/etc/bauh/appimage/updates_ignored.txt` for **root**)
- Cached package suggestions: `~/.cache/bauh/web/suggestions.txt` (or `/var/cache/bauh/web/suggestions.yml` for **root**)


##### <a name="type_arch">Arch packages/AUR<a>

Expand Down Expand Up @@ -287,7 +290,9 @@ suggest_optdep_uninstall: false # if the optional dependencies associated with
categories_exp: 24 # It defines the expiration time (in HOURS) of the packages categories mapping file stored in disc. Use 0 so that it is always updated during initialization.
aur_rebuild_detector: true # it checks if packages built with old library versions require to be rebuilt. If a package needs to be rebuilt, it will be marked for update ('rebuild-detector' must be installed). Default: true.
prefer_repository_provider: true # when there is just one repository provider for a given a dependency and several from AUR, it will be automatically picked.
suggestions_exp: 24 # it defines the period (in hours) in which the suggestions stored in disc will be considered up to date. Use 0 if you always want to update them.
```
- Cached package suggestions: `~/.cache/bauh/arch/suggestions.txt` (or `/var/cache/bauh/arch/suggestions.yml` for **root**)

##### <a name="type_deb">Debian packages<a>
- Basic actions supported: **search**, **install**, **uninstall**, **upgrade**
Expand All @@ -299,7 +304,7 @@ prefer_repository_provider: true # when there is just one repository provider f
- **purge**: removes the packages and all related configuration files
- Files:
- runnable applications index: `~/.cache/bauh/debian/apps_idx.json` (or `/var/cache/bauh/debian/apps_idx.json` for **root**)
- package suggestions: `~/.cache/bauh/debian/suggestions.txt` (or `/var/cache/bauh/debian/suggestions.txt` for **root**)
- cached package suggestions: `~/.cache/bauh/debian/suggestions.txt` (or `/var/cache/bauh/debian/suggestions.txt` for **root**)
- configuration: `~/.config/bauh/debian.yml` or `/etc/bauh/debian.yml`
- `index_apps.exp`: time period (**in minutes**) in which the installed applications cache is considered up-to-date during startup (default: `1440` -> 24 hours)
- `sync_pkgs.time`: time period (**in minutes**) in which the packages synchronization must be done on startup (default: `1440` -> 24 hours)
Expand All @@ -317,7 +322,6 @@ installation_level: null # defines a default installation level: "user" or "syst
- Custom actions supported:
- **Full update**: it completely updates the Flatpak apps and components. Useful if you are having issues with runtime updates.


#### <a name="type_snap">Snap</a>

- Make sure **snapd** is properly installed and enabled on your system: https://snapcraft.io/docs/installing-snapd
Expand Down Expand Up @@ -386,7 +390,7 @@ environment:
suggestions:
cache_exp: 24 # defines the period (in HOURS) in which suggestions stored on the disk are considered up to date during the initialization process. Use 0 so that they are always updated. Default: 24.
```

- Cached package suggestions: `~/.cache/bauh/web/suggestions.txt` (or `/var/cache/bauh/web/suggestions.yml` for **root**)

#### <a name="settings">General settings</a>

Expand All @@ -398,6 +402,7 @@ You can change some application settings via environment variables or arguments
- `--reset`: it cleans all configurations and cached data stored in the HOME directory.
- `--logs`: it enables logs (for debugging purposes).
- `--offline`: it assumes the internet connection is off.
- `--suggestions`: it forces loading software suggestions after the initialization process.


##### Configuration file (**~/.config/bauh/config.yml**)
Expand All @@ -407,14 +412,15 @@ download:
icons: true # allows bauh to download the applications icons when they are not saved on the disk
multithreaded: true # allows bauh to use a multithreaded download client installed on the system to download applications source files faster
multithreaded_client: null # defines the multi-threaded download tool to be used. If null, the default installed tool will be used (priority: aria2 > axel). Possible tools/values: aria2, axel
check_ssl: true # if the security certificate (SSL) should be checked before downloading files.
gems: null # defines the enabled applications types managed by bauh (a null value means "all available")
locale: null # defines a different translation for bauh (a null value will retrieve the system's default locale)
store_root_password: true # if the root password should be asked only once
memory_cache:
data_expiration: 3600 # the interval in SECONDS that data cached in memory will live
icon_expiration: 300 # the interval in SECONDS that icons cached in memory will live
suggestions:
by_type: 10 # the maximum number of application suggestions that must be retrieved per type
by_type: 20 # the maximum number of application suggestions that must be retrieved per type
enabled: true # if suggestions must be displayed when no application is installed
system:
notifications: true # if system popup should be displayed for some events. e.g: when there are updates, bauh will display a system popup
Expand Down Expand Up @@ -460,6 +466,30 @@ appimage
# flatpak # 'sharps' can be used to ignore a given line (comment)
```

##### <a name="suggestions">Custom suggestions / curated software</a>
- The software suggestions are download from [bauh-files](https://github.com/vinifmor/bauh-files) by default
- [appimage](https://github.com/vinifmor/bauh-files/blob/master/appimage/suggestions.txt)
- [arch](https://github.com/vinifmor/bauh-files/blob/master/appimage/suggestions.txt)
- [debian](https://github.com/vinifmor/bauh-files/blob/master/debian/suggestions_v1.txt)
- [flatpak](https://github.com/vinifmor/bauh-files/blob/master/flatpak/suggestions.txt)
- [snap](https://github.com/vinifmor/bauh-files/blob/master/snap/suggestions.txt)
- [web](https://github.com/vinifmor/bauh-files/blob/master/web/env/v2/suggestions.yml)

- Most of the files follow the pattern: `{priority_number}=${id or name}`
- Priority numbers: 0 (LOW), 1 (MEDIUM), 2 (HIGH), 3 (TOP)
- The priority number is used to sort the retrieved suggestions

- If Linux distributions want to provide their custom suggestions files:
- Create the file `/etc/bauh/suggestions.conf`
- The content is basically a mapping for each gem to a url or local file (absolute path).
- Example:
```
arch=https://mydomain.com/arch/suggestions.txt # remote file
appimage=/etc/bauh/appimage/suggestions.txt # local file (absolute path)
# snap = my mapping # comments with a '#' are allowed
```
- If a given gem name is omitted, its suggestions will be downloaded from the default location.
#### <a name="dirs">Directory structure, caching and logs</a>
- `~/.config/bauh` (or `/etc/bauh` for **root**): stores configuration files
- `~/.cache/bauh` (or `/var/cache/bauh` for **root**): stores data about your installed applications, databases, indexes, etc. Files are stored here to provide a faster initialization and data recovery.
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.10.2'
__version__ = '0.10.3'
__app_name__ = 'bauh'

import os
Expand Down
15 changes: 14 additions & 1 deletion bauh/api/abstract/context.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
import sys
from typing import Optional, Dict

from bauh.api.abstract.cache import MemoryCacheFactory
from bauh.api.abstract.disk import DiskCacheLoaderFactory
Expand All @@ -15,7 +16,7 @@ def __init__(self, download_icons: bool, http_client: HttpClient, app_root_dir:
cache_factory: MemoryCacheFactory, disk_loader_factory: DiskCacheLoaderFactory,
logger: logging.Logger, file_downloader: FileDownloader, distro: str, app_name: str,
app_version: str, internet_checker: InternetChecker, root_user: bool, screen_width: int = -1,
screen_height: int = -1):
screen_height: int = -1, suggestions_mapping: Optional[Dict[str, str]] = None):
"""
:param download_icons: if packages icons should be downloaded
:param http_client: a shared instance of http client
Expand All @@ -31,6 +32,7 @@ def __init__(self, download_icons: bool, http_client: HttpClient, app_root_dir:
:param internet_checker
:param screen_width
:param screen_height
:param suggestions_mapping
"""
self.download_icons = download_icons
self.http_client = http_client
Expand All @@ -51,6 +53,7 @@ def __init__(self, download_icons: bool, http_client: HttpClient, app_root_dir:
self.internet_checker = internet_checker
self.screen_width = screen_width
self.screen_height = screen_height
self._suggestions_mapping = suggestions_mapping

def is_system_x86_64(self):
return self.arch_x86_64
Expand All @@ -60,3 +63,13 @@ def get_view_path(self):

def is_internet_available(self) -> bool:
return self.internet_checker.is_available()

def get_suggestion_url(self, module: str, default: Optional[str] = None) -> Optional[str]:
if self._suggestions_mapping:
module_split = module.split(f'{self.app_name}.gems.')

if len(module_split) > 1:
gem_name = module_split[1].split('.')[0]
return self._suggestions_mapping.get(gem_name, default)

return default
8 changes: 7 additions & 1 deletion bauh/api/abstract/disk.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from abc import ABC, abstractmethod
from typing import Type
from typing import Type, Optional, Any, Dict

from bauh.api.abstract.cache import MemoryCache
from bauh.api.abstract.model import SoftwarePackage
Expand Down Expand Up @@ -29,6 +29,12 @@ def fill(self, pkg: SoftwarePackage, sync: bool = False):
"""
pass

def read(self, pkg: SoftwarePackage) -> Optional[Dict[str, Any]]:
"""
returns the cached data from the given package
"""
pass


class DiskCacheLoaderFactory(ABC):

Expand Down
8 changes: 8 additions & 0 deletions bauh/api/abstract/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,14 @@ class SuggestionPriority(Enum):
HIGH = 2
TOP = 3

def __gt__(self, other):
if isinstance(other, SuggestionPriority):
return self.value > other.value

def __lt__(self, other):
if isinstance(other, SuggestionPriority):
return self.value < other.value


class PackageSuggestion:

Expand Down
23 changes: 18 additions & 5 deletions bauh/api/abstract/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ class MessageType(Enum):
ERROR = 2


class ViewComponentAlignment(Enum):
CENTER = 0
LEFT = 1
RIGHT = 2
BOTTOM = 3
TOP = 4
HORIZONTAL_CENTER = 5
VERTICAL_CENTER = 6


class ViewObserver:

def on_change(self, change):
Expand All @@ -19,8 +29,10 @@ class ViewComponent(ABC):
"""
Represents a GUI component
"""
def __init__(self, id_: Optional[str], observers: Optional[List[ViewObserver]] = None):
def __init__(self, id_: Optional[str], alignment: Optional[ViewComponentAlignment] = None,
observers: Optional[List[ViewObserver]] = None):
self.id = id_
self.alignment = alignment
self.observers = observers if observers else []

def add_observer(self, obs):
Expand Down Expand Up @@ -114,10 +126,11 @@ class SelectViewType(Enum):

class SingleSelectComponent(InputViewComponent):

def __init__(self, type_: SelectViewType, label: str, options: List[InputOption], default_option: InputOption = None,
max_per_line: int = 1, tooltip: str = None, max_width: int = -1, id_: str = None,
capitalize_label: bool = True):
super(SingleSelectComponent, self).__init__(id_=id_)
def __init__(self, type_: SelectViewType, label: str, options: List[InputOption],
default_option: InputOption = None, max_per_line: int = 1, tooltip: str = None,
max_width: Optional[int] = -1, id_: str = None, capitalize_label: bool = True,
alignment: Optional[ViewComponentAlignment] = None):
super(SingleSelectComponent, self).__init__(id_=id_, alignment=alignment)
self.type = type_
self.label = label
self.options = options
Expand Down
3 changes: 3 additions & 0 deletions bauh/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ def main(tray: bool = False):
QCoreApplication.setAttribute(Qt.AA_UseHighDpiPixmaps)
QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling)

if bool(args.suggestions):
logger.info("Forcing loading software suggestions after the initialization process")

if tray or bool(args.tray):
from bauh.tray import new_tray_icon
app, widget = new_tray_icon(app_config, logger)
Expand Down
2 changes: 2 additions & 0 deletions bauh/app_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ def read() -> Namespace:
parser.add_argument('-v', '--version', action='version', version='%(prog)s {}'.format(__version__))
parser.add_argument('--logs', action="store_true", help='It activates {} logs.'.format(__app_name__))
parser.add_argument('--offline', action="store_true", help='It assumes the internet connection is off')
parser.add_argument('--suggestions', action="store_true",
help='It forces loading software suggestions after the initialization process')

exclusive_args = parser.add_mutually_exclusive_group()
exclusive_args.add_argument('--tray', action="store_true", help='If {} should be attached to the system tray.'.format(__app_name__))
Expand Down
Loading

0 comments on commit 30d2d58

Please sign in to comment.