A tool to add Wayland support for Chromium-based (browser/electron) apps by automatically adding necessary command-line flags to desktop files.
Waylandify intelligently modifies .desktop files to enable Wayland support without touching system files. It works by:
- Creating modified copies in
~/.local/share/applications/(user-level desktop files) - Automatically backing up any existing files before modification
- Parsing command arguments intelligently to avoid duplicating flags
- Providing easy restoration to revert changes
- Smart Flag Parsing: Properly handles various command-line flag formats (
--flag=value,--flag value,-f,%F, etc.) - Duplicate Prevention: Automatically detects and skips flags that are already present
- Feature Merging: Intelligently merges
--enable-featuresflags (Chromium-style) - Safe Modifications: Never modifies system files, only user-level desktop files
- Automatic Backups: Creates timestamped backups before any modifications
- Easy Restoration: Restore from backups or revert to system defaults with a single command
- Dry-Run Mode: Preview changes before applying them
- Diff View: See exactly what changes would be made
- Configurable: Define multiple programs with different flag sets
- Flatpak/Snap Support: Discovers desktop files from Flatpak and Snap installations
- XDG Compliant: Respects
XDG_CONFIG_HOMEandXDG_DATA_HOMEenvironment variables
Use astral/uv to install via git.
-
Initialize configuration:
waylandify init
-
Edit the configuration file at
~/.config/waylandify/config.tomlto add your programs -
Preview changes (dry-run mode):
waylandify apply --dry-run
-
Apply changes:
waylandify apply
Creates a default configuration file at ~/.config/waylandify/config.toml.
Applies Wayland flags to the applications defined in the config file.
Options:
--dry-run,-n: Preview what would be changed without making any modifications
Example:
# Preview changes
waylandify apply --dry-run
# Apply changes
waylandify applyLists all configured programs and their associated desktop files.
waylandify listShows the current status of waylandify modifications, including:
- Configuration file location and validity
- Modified desktop files
- Available backups
waylandify statusShows what changes would be made to desktop files in a unified diff format.
# Show all diffs
waylandify diff
# Show diff for specific program
waylandify diff "Electron Apps"Restore desktop files from backups or revert to system defaults.
Usage:
# List available backups
waylandify restore
# Restore from a specific backup
waylandify restore backup_20250126_123456_789012
# Remove modified files and use system defaults
waylandify restore --remove-onlyThe configuration file uses TOML format and is located at ~/.config/waylandify/config.toml (or $XDG_CONFIG_HOME/waylandify/config.toml if set).
Structure:
[[programs]]: Define multiple program entriesname: A descriptive name for this entryexecutables: List of executable names to search for (e.g.,["code", "code-insiders"])flags: List of command-line flags to addenabled: (optional) Set tofalseto skip this entry. Default:truemerge_enable_features: (optional) Merge--enable-featuresflags. Default:true
Example:
[[programs]]
name = "VS Code"
executables = ["code", "code-insiders", "code-oss"]
flags = [
"--enable-features=UseOzonePlatform",
"--ozone-platform=wayland",
"--enable-features=WaylandWindowDecorations",
]
[[programs]]
name = "Chromium Browsers"
executables = ["brave-browser", "google-chrome", "chromium"]
flags = [
"--enable-features=TouchpadOverscrollHistoryNavigation",
"--gtk-version=4",
]
# Disabled entry example
[[programs]]
name = "Disabled App"
executables = ["some-app"]
flags = ["--some-flag"]
enabled = falseWaylandify automatically merges multiple --enable-features flags into a single flag, as Chromium-based applications expect. For example:
flags = [
"--enable-features=UseOzonePlatform",
"--enable-features=WaylandWindowDecorations",
]Will be merged into:
--enable-features=UseOzonePlatform,WaylandWindowDecorations
This behavior can be disabled per-program by setting merge_enable_features = false.
-
Indexing: Waylandify first scans standard directories (including Flatpak and Snap locations) to build an efficient index of all
.desktopfiles. This index maps the executable names found in theirExec=lines to the corresponding desktop file paths. -
Matching: For each program defined in your
config.toml, Waylandify uses this index to find all.desktopfiles that reference any of the specified executables. -
Parsing: Uses a sophisticated parser to understand existing command arguments within the matched desktop files.
-
Modification: Adds new flags intelligently, avoiding duplicates and merging
--enable-featuresflags. -
Backup: Creates timestamped backups before any changes.
-
Application: Writes modified desktop files to
~/.local/share/applications/
Waylandify is designed to be safe:
- Never modifies system files: Only creates/modifies files in
~/.local/share/applications/ - Automatic backups: Every modification creates a timestamped backup in
~/.config/waylandify/backups/ - Metadata tracking: Keeps a record of all modifications in
metadata.json - Easy restoration: Multiple options to revert changes
- Backups:
~/.config/waylandify/backups/backup_TIMESTAMP/ - Metadata:
~/.config/waylandify/backups/metadata.json - Modified files:
~/.local/share/applications/*.desktop
Three ways to revert modifications:
-
Restore from specific backup:
waylandify restore backup_20250126_123456_789012
-
Remove modified files (system will use original desktop files):
waylandify restore --remove-only
-
Manual restoration: Copy files from backup directory manually
Waylandify searches for desktop files in the following locations:
/usr/share/applications- System applications/usr/local/share/applications- Locally installed applications~/.local/share/applications- User applications/var/lib/flatpak/exports/share/applications- System Flatpak apps~/.local/share/flatpak/exports/share/applications- User Flatpak apps/var/lib/snapd/desktop/applications- Snap applications- Directories from
$XDG_DATA_DIRS
flags = [
"--enable-features=UseOzonePlatform",
"--ozone-platform=wayland",
"--enable-features=WaylandWindowDecorations",
]flags = [
"--enable-features=UseOzonePlatform",
"--ozone-platform=wayland",
"--enable-features=WaylandWindowDecorations",
]flags = ["--gtk-version=4"]flags = ["--enable-features=TouchpadOverscrollHistoryNavigation"]After applying changes, you may need to:
- Log out and log back in
- Restart your desktop environment
- Update the desktop database:
update-desktop-database ~/.local/share/applications
If waylandify can't find the desktop file:
- Run
waylandify listto see what's detected - Check if the executable is in your PATH:
which <executable-name> - Manually search for desktop files:
find /usr/share/applications ~/.local/share/applications -name "*.desktop" - Verify the executable name in the desktop file matches your config
Some applications may require specific flag combinations. Check the application's documentation for recommended Wayland flags.
The project is organized into modules:
- cli.py: Command-line interface using Typer
- config.py: Configuration file management with Pydantic validation
- desktop.py: Desktop file parsing and modification
- exec_parser.py: Intelligent Exec command parsing and flag management
- discovery.py: Executable and desktop file discovery
- backup.py: Backup creation and restoration
# Install development dependencies
uv sync
# Run the CLI
uv run waylandify --help
# Run with a specific command
uv run waylandify statusContributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is open source. See LICENSE file for details.
Created by Jassiel Ovando