[appimage] refactoring: installed AppImages are now stored at '/usr/local/share/bauh' for the root user

This commit is contained in:
Vinicius Moreira
2021-11-29 10:38:21 -03:00
parent b3c1e72717
commit 0ecbb28219
4 changed files with 5 additions and 3 deletions

View File

@@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- desktop entries: `/usr/share/applications` - desktop entries: `/usr/share/applications`
- custom themes: `/usr/share/bauh/themes` - custom themes: `/usr/share/bauh/themes`
- symlinks/binaries : `/usr/local/bin` - symlinks/binaries : `/usr/local/bin`
- shared files: `/usr/local/share/bauh`
- UI - UI
- settings panel: - settings panel:

View File

@@ -191,7 +191,7 @@ bauh is officially distributed through [PyPi](https://pypi.org/project/bauh) and
- `Upgrade file`: allows to upgrade a manually installed AppImage file - `Upgrade file`: allows to upgrade a manually installed AppImage file
- `Update database`: manually synchronize the AppImage database - `Update database`: manually synchronize the AppImage database
- Installed applications are store at `~/.local/share/bauh/appimage/installed` - Installed applications are store at `~/.local/share/bauh/appimage/installed` (or `/usr/local/share/bauh/installed` for **root**)
- Desktop entries (menu shortcuts) of the installed applications are stored at **~/.local/share/applications** (or `/usr/share/applications` for **root**). Name pattern: `bauh_appimage_appname.desktop` - Desktop entries (menu shortcuts) of the installed applications are stored at **~/.local/share/applications** (or `/usr/share/applications` for **root**). Name pattern: `bauh_appimage_appname.desktop`
- Symlinks are created at `~/.local/bin` (or `/usr/local/bin` for **root**). They have the same name of the application (if the name already exists, it will be created as 'app_name-appimage'. e.g: `rpcs3-appimage`) - Symlinks are created at `~/.local/bin` (or `/usr/local/bin` for **root**). They have the same name of the application (if the name already exists, it will be created as 'app_name-appimage'. e.g: `rpcs3-appimage`)
- Downloaded database files are stored at **~/.cache/bauh/appimage** as **apps.db** and **releases.db** - Downloaded database files are stored at **~/.cache/bauh/appimage** as **apps.db** and **releases.db**

View File

@@ -12,3 +12,4 @@ TEMP_DIR = f'/tmp/{__app_name__}@{getuser()}'
LOGS_DIR = f'{TEMP_DIR}/logs' LOGS_DIR = f'{TEMP_DIR}/logs'
AUTOSTART_DIR = f'/etc/xdg/autostart' if user.is_root() else f'{Path.home()}/.config/autostart' AUTOSTART_DIR = f'/etc/xdg/autostart' if user.is_root() else f'{Path.home()}/.config/autostart'
BINARIES_DIR = f'/usr/local/bin' if user.is_root() else f'{Path.home()}/.local/bin' BINARIES_DIR = f'/usr/local/bin' if user.is_root() else f'{Path.home()}/.local/bin'
SHARED_FILES_DIR = f'/usr/local/share/{__app_name__}' if user.is_root() else f'{Path.home()}/.local/share/{__app_name__}'

View File

@@ -3,11 +3,11 @@ from pathlib import Path
from typing import Optional from typing import Optional
from bauh import __app_name__ from bauh import __app_name__
from bauh.api.paths import CONFIG_DIR, TEMP_DIR, CACHE_DIR, BINARIES_DIR from bauh.api.paths import CONFIG_DIR, TEMP_DIR, CACHE_DIR, BINARIES_DIR, SHARED_FILES_DIR
from bauh.commons import resource from bauh.commons import resource
ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
LOCAL_PATH = f'{Path.home()}/.local/share/{__app_name__}/appimage' LOCAL_PATH = f'{SHARED_FILES_DIR}/appimage'
INSTALLATION_PATH = f'{LOCAL_PATH}/installed/' INSTALLATION_PATH = f'{LOCAL_PATH}/installed/'
SUGGESTIONS_FILE = f'https://raw.githubusercontent.com/vinifmor/{__app_name__}-files/master/appimage/suggestions.txt' SUGGESTIONS_FILE = f'https://raw.githubusercontent.com/vinifmor/{__app_name__}-files/master/appimage/suggestions.txt'
CONFIG_FILE = f'{CONFIG_DIR}/appimage.yml' CONFIG_FILE = f'{CONFIG_DIR}/appimage.yml'