A utility to create small wrapper scripts for Flatpak applications, allowing you to launch them by their simplified name (e.g., chrome instead of flatpak run com.google.Chrome). It handles conflicts with system packages, remembers user preferences, and provides management tools.
- Generates wrappers for user and system Flatpak apps
- Automatic updates via systemd (user changes trigger immediately, system changes daily)
- Conflict resolution: Choose between system package or Flatpak app, with preference memory
- Aliases: Create custom names for wrappers
- Help and info:
--helpand--fpwrapper-infoflags on wrappers - Backup/restore: Export/import preferences and blocklists
- Management script: Interactive menu (with dialog GUI fallback) or CLI for configuring wrappers
- Block/unblock specific apps
- Customizable wrapper directory
- Environment variables: Set per-wrapper environment variables
- Pre-launch scripts: Run custom scripts before launching apps
- Post-run scripts: Execute cleanup or logging scripts after apps exit
Each generated wrapper provides these additional options:
--fpwrapper-help- Show detailed help with all available options--fpwrapper-info- Show wrapper and Flatpak app information--fpwrapper-config-dir- Show the Flatpak app's configuration directory--fpwrapper-sandbox-info- Show Flatpak sandbox details and permissions--fpwrapper-edit-sandbox- Interactive sandbox permission editor--fpwrapper-sandbox-yolo- Grant all permissions (use with extreme caution)--fpwrapper-set-override [system|flatpak]- Force preference for this wrapper--fpwrapper-set-pre-script <script>- Set a pre-launch script--fpwrapper-set-post-script <script>- Set a post-run script--fpwrapper-remove-pre-script- Remove pre-launch script--fpwrapper-remove-post-script- Remove post-run script--fpwrapper-force-interactive- Force interactive mode (useful in scripts)
Script Arguments: Pre-launch and post-run scripts receive: wrapper name, Flatpak ID, target application, and any additional arguments.
Wrappers automatically detect their execution context and behave accordingly:
When run from an interactive terminal, wrappers provide full functionality:
- Preference prompts and management
- Interactive sandbox editing
- Help and information commands
- All wrapper features available
When run from non-interactive contexts, wrappers automatically bypass themselves:
- Search PATH for next executable with the same name
- Execute system command directly if found
- Fall back to Flatpak if no system command exists
- No prompts or interactive features
- Clean, predictable behavior for desktop environments
You can force interactive mode in scripts using the environment variable:
# Force interactive mode in a script
FPWRAPPER_FORCE=interactive firefox --fpwrapper-help
# Or use the built-in flag
firefox --fpwrapper-force-interactive --helpUse Cases:
- Scripting: Force wrapper features in automated scripts
- Testing: Ensure wrapper functionality works as expected
- Debugging: Access wrapper help and diagnostics in scripts
- Custom Launchers: Create custom desktop entries that use wrapper features
For detailed information about interactive mode control, scripting, and advanced features, see:
- docs/FPWRAPPER_FORCE.md - Complete guide to
FPWRAPPER_FORCEenvironment variable - docs/ADVANCED_USAGE.md - Advanced scripting and automation examples
Debian/Ubuntu:
# Download the .deb from GitHub Releases
sudo dpkg -i fplaunchwrapper_*.deb
sudo apt-get install -f # Install dependencies if needed
# Generate wrapper scripts for your user
fplaunch-manage regenerate
# (Optional) Enable automatic updates
fplaunch-setup-systemdFedora/RHEL:
# Download the .rpm from GitHub Releases
sudo dnf install fplaunchwrapper-*.rpm
# Generate wrapper scripts for your user
fplaunch-manage regenerate
# (Optional) Enable automatic updates
fplaunch-setup-systemdImportant: Package installation installs system files and commands. Each user must run fplaunch-manage regenerate to generate wrappers in their home directory and optionally fplaunch-setup-systemd to enable automatic updates.
- Clone or download the scripts.
- Run
bash install.sh [optional_bin_dir]to install (default bin dir:~/.local/bin). You'll be prompted to enable automatic updates. - Ensure
~/.local/bin(or your chosen dir) is in your PATH.
Installation Notes:
- The installer will check for Flatpak, systemd, and crontab availability
- Automatic updates can use systemd (preferred) or fall back to crontab
- Bash completion is automatically installed to
~/.bashrc.d/if available, or copied to your bin directory - The installer generates initial wrappers for all installed Flatpak apps
- Launch apps:
chrome,firefox, etc. - Get info:
chrome --fpwrapper-infoorchrome --fpwrapper-helpfor detailed options. - Config dir:
cd "$(chrome --fpwrapper-config-dir)"to access app data. - Sandbox info:
chrome --fpwrapper-sandbox-infoto show Flatpak details. - Edit sandbox:
chrome --fpwrapper-edit-sandboxfor interactive permission editing. - YOLO mode:
chrome --fpwrapper-sandbox-yoloto grant all permissions (use with caution). - Set override:
chrome --fpwrapper-set-override [system|flatpak]to force preference (prompts if not specified). - Env vars: Set transient env vars via
fplaunch-manage set-env(for permanent, useflatpak override <app> --env=VAR=value). - Manage:
fplaunch-managefor interactive menu (uses dialog if available), or CLI commands likefplaunch-manage list,fplaunch-manage search <keyword>,fplaunch-manage info <name>. - Search:
fplaunch-manage search <keyword>to find wrappers by name, ID, or description. - Install:
fplaunch-manage install <app>to install a Flatpak and create wrapper. - Launch:
fplaunch-manage launch <name>to launch a wrapper.- Examples:
fplaunch-manage set-alias chrome browserfplaunch-manage export-prefs prefs.tar.gzfplaunch-manage export-config full_backup.tar.gzto export complete configurationfplaunch-manage info chrometo show detailed app info and manifestfplaunch-manage manifest chrome local > manifest.inito save local manifestfplaunch-manage set-env chrome MOZ_ENABLE_WAYLAND 1to set environment variablesfplaunch-manage set-script chrome ~/scripts/chrome-prelaunch.shto set pre-launch scriptfplaunch-manage set-post-script chrome ~/scripts/chrome-postrun.shto set post-run scriptfplaunch-manage remove-script chrometo remove pre-launch scriptfplaunch-manage remove-post-script chrometo remove post-run scriptfplaunch-manage block com.example.Appto block an app
fplaunch-manage: Main management utility with commands: list, search, remove, remove-pref, set-pref, set-env, remove-env, list-env, set-pref-all, set-script, set-post-script, remove-script, remove-post-script, set-alias, remove-alias, export-prefs, import-prefs, export-config, import-config, block, unblock, list-blocked, install, launch, regenerate, info, manifest, files, uninstall.fplaunch-generate: Generates/updates wrappers.fplaunch-setup-systemd: Configures systemd for auto-updates.fplaunch-cleanup: Removes all per-user artifacts (run before uninstalling).install.sh: Manual installation script (for source installs, accepts optional bin directory).uninstall.sh: Manual uninstallation script (for source installs).- Bash completion: Automatically configured for all commands.
- Required: Bash, Flatpak
- Optional for auto-updates: Systemd (user session) or crontab
- Optional for management UI: dialog package (falls back to CLI if not available)
- Optional for bash completion: Standard bash completion setup
Pre-launch scripts run before the Flatpak application starts. They are useful for:
- Setting up environment variables or temporary files
- Checking system requirements
- Starting dependent services
- Displaying warnings or messages
Post-run scripts execute after the Flatpak application exits. They can:
- Clean up temporary files created by pre-launch scripts
- Log application usage or exit codes
- Restart services that were modified
- Display completion messages
Both pre-launch and post-run scripts receive these arguments:
$1- Wrapper name (e.g., "chrome")$2- Flatpak ID (e.g., "com.google.Chrome")$3- Target application ("flatpak" or system command name)$@- All original arguments passed to the wrapper
- Pre-launch script failures prompt user to continue or abort
- Post-run scripts execute regardless of application exit status
- Scripts must be executable files with proper permissions
MIT
Common Issues:
- If wrappers don't launch, ensure your bin directory is in PATH
- If auto-updates don't work, check that systemd user session is running or crontab is available
- If bash completion doesn't work, source the completion file manually:
source ~/.bashrc.d/fplaunch_completion.bash
Debugging:
- Use
fplaunch-manage filesto see all generated files - Use
fplaunch-manage info <wrapper>to debug wrapper configuration - Check systemd status with
systemctl --user status flatpak-wrappers.*
Configuration Directory: ~/.config/flatpak-wrappers/
Generated Wrappers: Default to ~/.local/bin/ (configurable during installation)