# PacManager πŸ“¦ Package manager for **Arch Linux** based on **pacman**, with a Qt6 graphical interface. ## Features - πŸ” **Package search** - πŸ“¦ **Package installation** - πŸ—‘οΈ **Package removal** - πŸ”„ **Individual or global updates** - πŸ“‹ **History of all actions** - 🧩 **Multi-provider**: pacman and Flatpak built in, plus **plugins** to add other managers (apt, dnf, …) ## Architecture ``` package-manager/ β”œβ”€β”€ CMakeLists.txt # Build root β”œβ”€β”€ include/ β”‚ β”œβ”€β”€ package-manager.h # Package manager interface (IPackageManager) β”‚ β”œβ”€β”€ provider-plugin.h # C ABI contract for provider plugins β”‚ β”œβ”€β”€ pacman-manager.h # pacman manager (Arch Linux) β”‚ β”œβ”€β”€ flatpak-manager.h # Flatpak manager β”‚ β”œβ”€β”€ plugin-manager.h # Provider registry + plugin loading β”‚ β”œβ”€β”€ main-window.h # Main GUI β”‚ β”œβ”€β”€ history-manager.h # Action history β”‚ └── package-model.h # Qt model for the list β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ main.cpp β”‚ β”œβ”€β”€ main-window.cpp β”‚ β”œβ”€β”€ pacman-manager.cpp β”‚ β”œβ”€β”€ flatpak-manager.cpp β”‚ β”œβ”€β”€ plugin-manager.cpp β”‚ β”œβ”€β”€ history-manager.cpp β”‚ └── package-model.cpp β”œβ”€β”€ plugins/ β”‚ └── example-provider/ # Example external plugin (template) β”œβ”€β”€ tests/ # Unit tests (assert, no Qt) └── resources/ ``` ## Compilation (Arch Linux) ### Dependencies ```bash sudo pacman -S qt6-base cmake gcc base-devel ``` ### Build ```bash cd package-manager # Create the build directory mkdir -p build && cd build # Configure cmake .. -DCMAKE_INSTALL_PREFIX=/usr # Compile make -j$(nproc) # Install (optional) sudo make install ``` ### Run ```bash # From the build directory ./PacManager # Or from /usr/bin after install PacManager ``` ## Graphical interface The interface uses **Qt6** with a dark theme, a **navigation sidebar** and stacked pages: - 🏠 **Dashboard**: statistics cards, quick actions and recent activity - πŸ” **Search**: search bar, package table on the left and details on the right - πŸ“¦ **Installed**: list with **instant name filter** (local, no pacman re-run) - ⬆️ **Updates**: outdated packages detected by `pacman -Qu`, "Update all" button - πŸ“‹ **History**: filterable table (installs / removals / updates) - πŸ“œ **Logs**: built-in `/var/log/pacman.log` viewer - 🧩 **Providers**: lists all managers (built-in and plugins), enable / disable and plugin rescan ### Interface overview ```text β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ File Tools Help β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ πŸ“¦ PacManager β”‚ Search β”‚ β”‚ β”‚ Find and install packages β”‚ β”‚ 🏠 Dashboard β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ πŸ” Search β”‚ β”‚ πŸ” Search for a package (e.g. firefox)... β”‚ β”‚ Search β”‚ β”‚ β”‚ πŸ“¦ Installed β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ ⬆️ Updates β”‚ [+ Install] [- Remove] [^ Update] [^^ Update all] β”‚ β”‚ πŸ“‹ History β”‚ β”Œ Name β”‚ Version β”‚ Repo β”‚ Status ┐ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ πŸ“œ Logs β”‚ β”‚ firefox β”‚ 128.0 β”‚ extra β”‚ βœ… Installed β”‚ β”‚ firefox β”‚ β”‚ β”‚ β”‚ β”‚ vlc β”‚ 3.0.21 β”‚ extra β”‚ βœ… Installed β”‚ β”‚ Version: 128.0 β”‚ β”‚ β”‚ β”‚ β”‚ ... β”‚ β”‚ β”‚ β”‚ β”‚ [extra] [289 MB] β”‚ β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ β”‚ πŸ”„ Refresh β”‚ β”‚ Fast and secure β”‚ β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ pacman 1.0.0 | Packages shown: 6 | History entries: 12 β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` ## Package managers (providers) The `IPackageManager` interface (implemented by `PacmanManager` and `FlatpakManager`) defines: | Method | Description | |--------|-------------| | `getName()` | Manager name | | `getVersion()` | Manager version | | `getDescription()` | Description | | `canSearch()` | Supports search | | `canInstall()` | Supports installation | | `canRemove()` | Supports removal | | `canUpdate()` | Supports updates | | `canListInstalled()` | Supports listing installed packages | | `isAvailable()` | Checks whether the tool is installed | | `requiresPassword()` | True when operations go through sudo (pacman) | | `search(query)` | Search for packages | | `install(name, callback)` | Installation | | `remove(name, callback)` | Removal | | `update(name, callback)` | Update | | `listInstalled()` | List installed packages | | `listUpdates()` | List outdated packages | | `refresh(callback)` | Refresh the sources | Search queries **all active providers at once**: every result shows its origin in the **Provider** column (Pacman, Flatpak, …), and the Installed / Updates pages are aggregated. Install, remove and update are routed automatically to the right manager. The sidebar **Providers** page lets you enable / disable each provider, rescan plugins and **install a missing tool** (e.g. "Install tool" for Flatpak runs `sudo pacman -S flatpak`, then the provider becomes available). ### Adding a provider (plugins) Pacman and Flatpak are **built-in**. Flatpak installs auto-add the flathub remote when missing and fall back to a **per-user** install (no password) when the system-wide install fails (polkit, homonymous remotes) β€” the real error is shown on failure. An app installed via Flatpak appears immediately in the desktop launcher: its `.desktop` entries and icons are linked into `~/.local/share/applications` and `~/.local/share/icons` (the XDG dirs scanned by **every** environment: wofi, GNOME, KDE…), exactly like a pacman install, and are removed again on uninstall. Search shows the real status of each app (Installed / Update available). This is covered by an **integration test** that drives the real flatpak CLI (install, list, update, search, uninstall). To add another manager (apt, dnf, zypper, or another distro's repos) without touching the application: 1. Implement `IPackageManager` in a `.cpp` file (copy `plugins/example-provider/example-provider.cpp` as a template). 2. Export the C ABI contract with the `FWS_PROVIDER_PLUGIN(MyManager, "id", "Name", "1.0.0", "Description", "Author")` macro. 3. Compile it as a shared library and drop it into `~/.local/share/PacManager/plugins/` or `plugins/` next to the executable. 4. Click **Rescan** on the Providers page. Building the example plugin: ```bash cmake -B build -DFWS_BUILD_EXAMPLE_PLUGIN=ON && cmake --build build # build/plugins/libsample-provider.so is copied next to the executable ``` The plugin must be compiled with the same compiler and headers as the application (like a regular Qt plugin). ## Development & conventions This project follows the **FWS** organisation conventions, detailed in `AGENTS.md`: - **Branches**: `type/description` (e.g. `feat/login`, `fix/typo`). - **Commits**: message in **English**, **Conventional Commits** format `(): `. Allowed types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`. Short, imperative title; the body explains only the **why**. - **Naming**: `kebab-case` files; identifiers (variables, functions, classes) in **English**. - **Code & comments**: in **English**, "why" style (document the non-obvious β€” design choices, trade-offs β€” not the trivial). - **Tests**: `*.test.*` files with `describe` / `it` names in English; run tests (and typecheck / lint when present) before considering a task done. Run them with `ctest` from `build/`. - **Issues & bugs**: tracked through **issues** linked to the **Kanban** board; any PR fixing a bug references the issue (`Fixes #123`); do not close or modify an issue without explicit request. - **Sensitive files (`.gitignore`)**: never commit `.env*`, `.freebuff/`, `build/` / `dist/` / `target/` / `__pycache__/`, `node_modules/`, secrets. A `.gitignore` exists at the repo root. ## License Coming soon